rjnitke,
In your first post beginning this thread, you said you needed to calculate minutes and had a problem when start and end times spanned midnight.
Putting the following into a VBA Immediate Window returns 38.
?DateDiff ("n", #9/7/3 23:44:22#, #9/8/3 0:22:55#)
You should be able to substitute your starting date/time for
#9/7/3 23:44:22#
and your ending date/time for
#9/8/3 0:22:55#
to get an accurate result in minutes.
NOTE that secords are dropped, so it could be a minute short.
For this to work, your field types in your table must be date/time. Also note, even if you're primarily interested in the time, those fields are always stored as date + time. See Microsoft Knowledgebase article 210276 for more information.
desikan,
My post to you was meant as a starting point, NOT a solution. Converting a null value to zero and then subtracting a date/time is not likely to prove useful.
You'll have to work out the details - maybe substituting something for the 0 in
Int(CSng((nz(EndDtTime,0) - StartDtTime) * 24 * 60))
Good Luck,
Bob
Please view Thread181-473997 for helpful hints regarding this site.