A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date Math to Milliseonds



 
 
Thread Tools Display Modes
  #1  
Old January 2nd, 2006, 03:25 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date Math to Milliseonds

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

  #2  
Old January 2nd, 2006, 04:04 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date Math to Milliseonds

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.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jack" wrote in message
...
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



  #3  
Old January 2nd, 2006, 04:18 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Date Math to Milliseonds

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
Please feel free to quote anything I say here.

Allen Browne wrote:

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.

Jack wrote:
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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NETWORKDAYS - Multiple Date Selection Annabelle General Discussion 3 October 4th, 2005 07:04 PM
Date Range and Average F/X Rate David General Discussion 0 June 23rd, 2005 02:26 PM
Revised Date Question Spectra Running & Setting Up Queries 0 March 18th, 2005 12:19 PM
Date Math Problem Dkline Worksheet Functions 4 March 4th, 2005 04:11 PM
Math with Date Mergefield StephenW Mailmerge 2 January 5th, 2005 06:11 PM


All times are GMT +1. The time now is 07:34 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.