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

ID: Q198453


The information in this article applies to:


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("Friday, January 1, 1999") 
However, the following expression returns a value of True:

IsDate("January 1, 1999") 


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/99","DDDD, MMMM D, YYYY") 
returns the value
Sunday, January 10, 1999


MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Microsoft Access.


  2. Press CTRL+G to open the Immediate window.


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


  4. 
    ?IsDate("Friday, January 01, 1999") 
The function returns a value of False.


REFERENCES

For more information about the IsDate() function, click Microsoft Access Help on the Help menu, type IsDate function example in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For more information about the Format() function, click Microsoft Access Help on the Help menu, type Format function in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Additional query words: cardinal days


Keywords          : kbprg kbdta 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: July 15, 1999