PRB: Incorrect Time Calculations in Years Prior to 1900Article ID: Q109339
SYMPTOMS
DateAdd("n",30,#January 1, 1776 9:00:00 AM#) should add 30 minutes to the value, but instead returns: January 1, 1776 8:30AM CAUSE Microsoft Access stores dates as serialized numbers that represent the number of days from a reference date. The time component is represented by the digits to the right of the decimal point. Since Microsoft Access uses December 31, 1899 as the reference date, all dates prior to that date are stored as negative numbers. Microsoft Access correctly interprets larger negative whole numbers as earlier dates, but incorrectly interprets larger negative fractions as an earlier time. RESOLUTION
NOTE: In the following example, an underscore (_) is used as a line- continuation character. Remove the underscore when re-creating example. IIf([MyDate]<#12/31/1899#, DateAdd("n",-30,[MyDate]),_ DateAdd("n",30,[MyDate])) STATUS Microsoft has confirmed this to be a problem in Microsoft Access versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0. REFERENCES
|
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
©1997 Microsoft Corporation. All rights reserved. Legal Notices.
Additional reference words: 1.00 1.10 query ab
KBCategory: kbusage
KBSubcategory: ExrOthr