ACC: IsDate() Returns False with Date in Long Date Format

Last reviewed: October 20, 1997
Article ID: Q175385
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

When you use the IsDate() function with a date in Long Date format, the function returns a value of False. For example, the following expression returns a value of False:

   IsDate("Thursday, January 1, 1998")

However, the following expression returns a value of True:

   IsDate("January 1, 1998")

CAUSE

The IsDate() function does not recognize days of the week; therefore, it does not recognize a date that is in Long Date format.

RESOLUTION

Do not use a date in Long Date format with the IsDate() function. If you want to verify the correct weekday for a particular date, use the Format() function to show the weekday. For example, the expression

    Format("1/10/98","DDDD, MMMM D, YYYY")

returns the value

    Saturday, January 10, 1998

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Microsoft Access.

  2. If you are using Microsoft Access version 7.0 or later, press CTRL+G to open the Debug window. If you are using Microsoft Access 2.0, follow these steps to open the Immediate window:

        a. Open any database.
    

        b. Click the Module tab, and then click New.
    

        c. On the View menu, click Immediate Window.
    

  3. Type the following expression, and then press ENTER:

          ?IsDate("Tuesday, January 01, 1991")
    

If you are using Microsoft Access version 7.0 or later, the function returns a value of False to the Debug window. If you are using Microsoft Access 2.0, the function returns a value of 0 to the Immediate window.

REFERENCES

For more information about the IsDate() function, search the Help Index for "IsDate function."

For more information about the Format() function, search the Help Index for "Format function."


Additional query words: cardinal days
Keywords : kbprg
Version : WINDOWS:1.0,1.1,2.0,7.0,97
Platform : WINDOWS
Hardware : x86
Issue type : kbprb
Solution Type : Info_Provided


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: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.