ACC: DateDiff() Ignores Start Date, Not End Date, with "ww" (125003)
The information in this article applies to:
This article was previously published under Q125003 Novice: Requires knowledge of the user interface on single-user computers.
SYMPTOMS
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.
Modification Type: | Major | Last Reviewed: | 6/25/2002 |
---|
Keywords: | kbusage KB125003 |
---|
|