Microsoft KB Archive/136043

= How to Allow Empty Fields in Visual FoxPro Crosstab Queries =

Article ID: 136043

Article Last Modified on 2/15/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q136043



SUMMARY
Crosstab queries created in FoxPro for Windows version 2.6 allowed empty fields in the output. In Visual FoxPro, however, the default behavior is to insert .NULL. as a placeholder where empty fields exist in the output.



Step-by-Step Procedure
To have Visual FoxPro crosstab queries use empty fields instead of the .NULL. placeholder, follow these steps:

 Open Vfpxtab.prg and save it as Myxtab.prg. In Myxtab.prg, search for SET NULL ON and change it to SET NULL OFF.  Search for this: IF ISNULL(EVAL(FIELD(m.i))) LOOP ENDIF Replace it with this: cFieldName = field(m.i)  IF ISBLANK(&cFieldName) LOOP ENDIF   In the Command window, type the following commands: _GENXTAB = "C:\VFP\MYXTAB.PRG" MODIFY COMMAND NULLTEST.   Place the following code in Nulltest: SELECT Customer.city, Customer.contact,; COUNT(Customer.maxordamt); FROM tastrade!customer; GROUP BY Customer.city, Customer.contact; ORDER BY Customer.city, Customer.contact; INTO CURSOR SYS(2015) DO (_GENXTAB) WITH 'Query',.t.,.t.,.t.,,,,.t.,1

BROWSE NOMODIFY 

Additional query words: VFoxWin

Keywords: KB136043

-

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

© Microsoft Corporation. All rights reserved.