Time query - Jeff Boyce please respond

G

Guest

Jeff,
Thanks for your reply but I am still stuck and need help.
When I import the times into the database from a speadsheet I don't have a
date value in the field the time is imported in a military time format.
Example login time = 18:00 logout time = 0:23

I was thinking that creating a function within a module would be the best
way to go. How do you call a function within a query?

I appreciate the help but can you be a little more detailed in your reply.
I need all the help I can get.

Thanks again
Maria




Jeff Boyce said:
Maria

Consider using the DateDiff() function, with the "nn" (minutes) level of
precision. Are your In/Out fields formatted as Date/Time? If so, an actual
Date AND Time are being entered.

Good luck

Jeff Boyce
<Access MVP>

MariaL said:
I am creating a report based on a query that subtracts a persons Login Time
from their Log Out Time: Currently the query has this expression
Hours: TimeValue([import]![Logout Time])-TimeValue([Login Time])
This works fine if the person logs in and logs out the same day. But if
the
person logs in at 9:31 pm and logs off at 12:43 am (the next day but the
same
shift) I am getting a result of 20:48 hours. I need to have a function
that
will handle the after midnight logouts so the total work hours won't be
skewed in the report that I create.

Thanks
 
J

Jeff Boyce

<if you keep the posts in the original thread, you gain the benefit of folks
being able to follow the entire thread>

Jeff

MariaL said:
Jeff,
Thanks for your reply but I am still stuck and need help.
When I import the times into the database from a speadsheet I don't have a
date value in the field the time is imported in a military time format.
Example login time = 18:00 logout time = 0:23

I was thinking that creating a function within a module would be the best
way to go. How do you call a function within a query?

I appreciate the help but can you be a little more detailed in your reply.
I need all the help I can get.

Thanks again
Maria




Jeff Boyce said:
Maria

Consider using the DateDiff() function, with the "nn" (minutes) level of
precision. Are your In/Out fields formatted as Date/Time? If so, an
actual
Date AND Time are being entered.

Good luck

Jeff Boyce
<Access MVP>

MariaL said:
I am creating a report based on a query that subtracts a persons Login
Time
from their Log Out Time: Currently the query has this expression
Hours: TimeValue([import]![Logout Time])-TimeValue([Login Time])
This works fine if the person logs in and logs out the same day. But
if
the
person logs in at 9:31 pm and logs off at 12:43 am (the next day but
the
same
shift) I am getting a result of 20:48 hours. I need to have a function
that
will handle the after midnight logouts so the total work hours won't be
skewed in the report that I create.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top