[AccessD] SQL datetime to Access date conversion SOLVED - sloppy math.

Doug Steele dbdoug at gmail.com
Tue Sep 1 09:36:35 CDT 2009


Thanks to all who replied, and apologies for not writing a more detailed
question.  It was me - I was splitting the time out of the datetime field
using the following formula to get the fraction after the decimal point:

Timepart = CSng(myDateTime)-CInt(CSng(myDateTime))

as soon as I changed that to use CDbl instead of CSng, it started working.
I'm surprised at the difference (I need to do some research on this).  As an
example, 1:00:00 PM using CSng comes out as .54295875 and using CDbl comes
out as .5416666667.  That's a difference of .00129208 of a day or
approximately 1.85 minutes.

Doug Steele



On Mon, Aug 31, 2009 at 5:16 PM, Stuart McLachlan <stuart at lexacorp.com.pg>wrote:

> How about posting your Update Query?
>
>



More information about the AccessD mailing list