Microsoft KB Archive/84547

= PRB: DateValue Argument Gives &quot;Illegal Function Call&quot; Error =

Article ID: 84547

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 1.0 Standard Edition

-



This article was previously published under Q84547



SYMPTOMS
You will correctly get an &quot;Illegal function call&quot; error for the DateValue argument if the short date (the three numbers representing the month, day, and year such as 4/24/92) does not follow the order of the date format selected under International settings in the Windows Control Panel.



STATUS
This behavior is by design.



MORE INFORMATION
The DateValue function returns a serial number that represents the date of the string argument. The string argument can be a date in abbreviated form (three numbers that represent the month, day, and year). However, this has to conform to the Short Date Format selected in the International settings of the Control Panel.

By default, the order is MDY or the month followed by the day and then the year separated by a slash (/) or a hyphen (-). An example of a valid argument is 4/24/92 for the date April 24, 1992. Using 24/4/92 would produce an &quot;Illegal function call&quot; error.

NOTE: For the long form of the date, DateValue recognizes April 24, 1992, Apr 24, 1992, 24-Apr-1992, and 24 April 92&quot;.

Remember that you will have to restart Windows for any changes made in the International settings to take effect.

Additional query words: 2.00 3.00

Keywords: kbprb KB84547

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.