Date Math to Milliseonds

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I noticed the datediff function will provide date math to the nearest
second, but how can I perform date math to the nearest millisecond?

Thanks in advance!
Jack
 
You can't get that kind of granularity out of the Date/Time data type in
Access.

Use the Currency data type to store the duration in seconds.
 
Remember that the fractional part of a date is measured in days, so if
you need to convert those, you'll need to multiply the fractional part
by 86,400 (=24*60*60) to get the number of seconds to store into your
[Seconds] field. Going the other way (and you'll likely lose
precision), you'd divide [Seconds] by 86,400 to get a value that you can
store in a Date/Time field.

Since you're apparently looking for a function to mimic DateDiff(), and
since you'll likely be working with values occupying 2 fields (showing
date and seconds), I think you'll want to write a VBA function to do
that, and then in Queries call your own function instead of DateDiff().

-- Vincent Johns <[email protected]>
Please feel free to quote anything I say here.
 

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

Back
Top