ACC: DateDiff() Ignores Start Date, Not End Date, with "ww"

Last reviewed: April 2, 1997
Article ID: Q125003
The information in this article applies to:
  • Microsoft Access version 2.0

SYMPTOMS

Novice: Requires knowledge of the user interface on single-user computers.

The online Help topic for the DateDiff() function states that when you compute the number of days (for example, the number of Sundays) between two dates using the "ww" interval, Microsoft Access ignores the end date if it falls on a Sunday but counts the beginning date if it falls on a Sunday. This information is incorrect.

RESOLUTION

When you use the "ww" interval in the DateDiff() function, Microsoft Access ignores the start date in its count if it falls on the day being counted, and counts the end date if it falls on the day being counted.

MORE INFORMATION

You can use the DateDiff() function to determine how many time intervals exist between two dates. For example, you can use the DateDiff() function to calculate the number of days between an order date and its ship date, or the number of weeks between today and the end of the year.

The exact value returned by the DateDiff() function can depend on the settings of the First Weekday and First Week options in the Options dialog box or on the values of the firstweekday or firstweek arguments. For example, if you set firstweekday to Wednesday and interval to "ww" then the DateDiff() function returns the number of Wednesdays between two dates.

NOTE: In Microsoft Access for Windows 95 version 7.0, the First Weekday and First Week options are NOT available. You cannot set these options through Visual Basic for Applications. Microsoft Access 7.0 uses Sunday as the default First Weekday, and January 1 as the default First Week.

REFERENCES

For more information about the DateDiff() function, search for "DateDiff," and then "DateDiff Function" using the Microsoft Access Help menu.


Additional query words: date diff dif
Keywords : DcmHlp kbusage
Version : 2.0 7.0
Platform : WINDOWS
Hardware : X86
Issue type : kbdocerr


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.

Last reviewed: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.