FIX: DATE() Function Does Not Propagate NULLs Properly (221725)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

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.

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbVS600sp3fix kbXBase KB221725