Microsoft KB Archive/175385

= ACC: IsDate Returns False with Date in Long Date Format =

Article ID: 175385

Article Last Modified on 1/22/2007

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q175385



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



SYMPTOMS
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



Steps to Reproduce Behavior
 Start Microsoft Access. 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:

 Open any database. Click the Module tab, and then click New.</li> On the View menu, click Immediate Window.</li></ol> </li> Type the following expression, and then press ENTER:

?IsDate("Tuesday, January 01, 1991") </li></ol>

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.

<div class="references_section">