Below is my table structure in ms access,
SNo Time EmpId Date Type
-------------------------------------------
1 09:20:53 AM 1 9/12/2012 IN
2 09:50:12 AM 1 9/12/2012 OUT
3 09:52:09 AM 1 9/12/2012 IN
4 12:15:10 PM 1 9/12/2012 OUT
The output should compare time and find the difference in 1st two rows and the next 2 (3rd and 4th) rows
Output required is,
EmpId Date Time
1 9/12/2012 0:30:41
1 9/12/2012 2:23:01
Could Somebody kindly help please.Would really appreciate it, Thanks.
I think this query is close to what you want, assuming your
DateandTimefields are both Date/Time data type. If they are actually text type, you can transform their values withCDate(). But either way, I think a query would be easier with a single field to hold both the date and time rather than separate fields for each.BTW,
Date,TimeandTypeare reserved words and therefore not ideal choices as field names. Although those names weren’t a deal-breaker for this query, you could avoid other potential headaches by renaming those fields if possible.