[AccessD] Loop Until Date=Date

Gustav Brock Gustav at cactus.dk
Wed Jan 23 12:25:53 CST 2008


Hi Mark

It is not just in Access or VBA, it's everywhere where floating point values are used for date time values.

In SQL Server it may or may not be worse as VBA can round to 1 ms (and below for non-extreme date values) while SQL Server only has a resolution of about 3.33 ms by always rounding to 0, 3, or 7:

'  ms  SqlServer
'   0    0
'   1    0
'   2    3
'   3    3
'   4    3
'   5    7
'   6    7
'   7    7
'   8    7
'   9   10
'  10   10
'  11   10
'  12   13
'  13   13
'  14   13
'  15   17
'  16   17
'  17   17
'  18   17
'  19   20

 - and so on.

However, it also features the SmallDateTime data type with a limited range of January 1, 1900 to June 6, 2079 which may be fine for many purposes and rounds to the second which may have helped you if you did the calculation in a stored procedure outside Access.

/gustav


>>> markamatte at hotmail.com 23-01-2008 18:54:03 >>>

Thanks Everyone,

I never thought of 30 minutes as 1/48 of a day.  It does feel better knowing that my looking at 2 identical things...and them not being = was my ignorance and not my insanity.  

Is this 'issue' just in access...maybe excel...and what about SQL Server?

Thanks,


Mark A. Matte






More information about the AccessD mailing list