M
maneeshkhare
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
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