Qry or report help

David B

Board Regular
Joined
Jun 3, 2006
Messages
75
Hi Folks.
I have inherited a DB for staff clock in/outs. The staff use a barcode-card swipe the card as they start work etc:
Table looks like:'
ID, Emp_ID, Clock,
267, 10389 , 29/06/2011 07:44 AM
268 , 11987, 29/06/2011 08:14 AM
269, 11003, 29/06/2011 08:09 AM
270, 11678, 29/06/2011 07:59 AM
271, 11987, 29/06/2011 07:00 PM
272, 11003, 29/06/2011 05:04 PM
273, 11678 , 29/06/2011 03:17 PM
274, 10389, 29/06/2011 05:25 PM

How can I run a qry or a report that shows me the following the next day
ID, Emp_ID, Clock in, Clock out
267, 10389 , 29/06/2011 07:44 AM , 29/06/2011 05:25 PM
268, 11987, 29/06/2011 08:14 AM , 29/06/2011 07:00 PM
269 , 11003, 29/06/2011 08:09 AM , 29/06/2011 05:04 PM
270, 11678 , 29/06/2011 07:59 AM , 29/06/2011 03:17 PM

I cant work out how to have the out time show beside he in-time

Appreciate any suggestions
thanks db
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
David, just checking...

Are all shifts on the same day? ie, no-one clocking on at, say, 8 PM and off at 4 AM the next day?

Denis
 
Upvote 0
HI Denis
All same way. Start in the AM clock out in the PM.
Although I did see 1 record where he clocked in at 08:00am and left at 11:30am. But that was/is very rare.
So yes always the same way
db
 
Upvote 0
Try this...
I called the table Bundy. Change to suit. The ID field is DummyID, the other fields are as you gave them.

Code:
SELECT First(Bundy.DummyID) AS RecID, Bundy.Emp_ID, Min(Bundy.Clock) AS [In], Max(Bundy.Clock) AS Out
FROM Bundy
GROUP BY Bundy.Emp_ID, Int([Clock])
ORDER BY First(Bundy.DummyID);

Denis
 
Upvote 0
Here's an update; an extra field gives elapsed time. You will need to format the Elapsed column as Short Time.
Code:
SELECT First(Bundy.DummyID) AS RecID, Bundy.Emp_ID, Min(Bundy.Clock) AS [In], Max(Bundy.Clock) AS Out, Max([Clock])-Min([Clock]) AS Elapsed
FROM Bundy
GROUP BY Bundy.Emp_ID, Int([Clock])
ORDER BY First(Bundy.DummyID);

Denis
 
Upvote 0
Wow- Denis
Once again thank you so much. That result is exactly what I was after.

You gotta love this forum. You ask for help and someone always comes to your rescue.

thanks again
db
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,703
Members
452,938
Latest member
babeneker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top