Microsoft KB Archive/221725

= FIX: DATE Function Does Not Propagate NULLs Properly =

Article ID: 221725

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q221725



SYMPTOMS
Placing a NULL in the DATE function causes the following error:

Function argument, value, type or count is invalid.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed



MORE INFORMATION
The syntax of the DATE function is DATE([nYear, nMonth, nDay]). Placing a NULL in any of the parameters causes the error.

Steps to Reproduce Behavior
Open the Command window, and type the following:

? DATE(null,3,2)

The error listed in the SYMPTOMS section appears.

Using the NULL in place of the following parameters also causes the error:

? DATE(1998,null,2)&& should return January for the month

? DATE(1998,3,null)&& should return first day

If NULL appears in place of the year, Visual FoxPro should substitute the current year or month. If NULL replaces the month, January should be returned for the month. If NULL replaces the day parameter, it should default to the first day of the month.

Keywords: kbbug kbfix kbxbase kbvs600sp3fix KB221725

-

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

© Microsoft Corporation. All rights reserved.