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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Milliseconds in Date/Time in MS Access



 
 
Thread Tools Display Modes
  #1  
Old November 15th, 2005, 07:45 PM
external usenet poster
 
Posts: n/a
Default Milliseconds in Date/Time in MS Access

I came across a problem in my application. We wanted to be able to
sort Date/Time, whose entries included milliseconds. However, MS
Access does not allow ms in Date/Time entry. So this is what I did
(just thought somebody might find this handy)

1. From .NET, whatever DateTime var you have, get its 'Ticks'
datetimevar.Ticks This is a long integer telling you the number of
'ticks' since epoch (a ref point).

2. Since MS Access will not support the length of such a long integer
(long in MS Access is only 1 Billion +ve and -ve). So divide it by
something like 1000000000.0000 to get a double value in your program,
and feed this to the mdb database, in place of the Date/Time. Now you
have something that gives the exact precision of your time in .NET
program.

3. Make sure your table supports double in this field of mdb, with
appropriate places of decimal.

4. Now you can have the table with as much precision for the Date/Time
as you want.

regards,
Maneesh

  #2  
Old November 15th, 2005, 07:48 PM
external usenet poster
 
Posts: n/a
Default Milliseconds in Date/Time in MS Access

It won't be 'readable' physically, but it works for
1. Sorting the table by this field, reflecting the precision of
DataTime u need
2. Reading and reconverting back to DateTime var in .NET code, as long
as u remember to multiply with whatever power of 10 you divided by at
the time of storing.

 




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
2002 vs 2003 Patrick Stubbin General Discussion 2 May 17th, 2005 07:27 AM
The "Right" web hosting for data access pages?? Ron Ehrlich General Discussion 9 May 6th, 2005 05:49 AM
Book recommendations, please Top Spin New Users 2 March 1st, 2005 12:43 AM
How to stop opening of multiple instance of Access 2000 after upd. Taika Bilbo Database Design 9 January 12th, 2005 08:34 PM
MICROSOFT INVESTING HEAVILY IN ACCESS Mike Painter General Discussion 39 October 15th, 2004 03:56 PM


All times are GMT +1. The time now is 05:23 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.