Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF() Question
Message
From
20/05/1999 09:23:43
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
20/05/1999 09:18:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00220792
Message ID:
00220797
Views:
22
>I have the following statement in my .prg, which keeps on producing the error message "Function argument value, type, or count is invalid":
>
>lcSQLString = "INSERT INTO DatabaseName..TableName(field1,field2) VALUES("+;
>IIF(ISNULL(MyCursor.field1),NULL,"'"+ALLTRIM(MyCursor.field1)+"'")+","+;
>IIF(ISNULL(MyCursor.field2),NULL,ALLTRIM(STR(MyCursor.field2)))+")"
>
>where:
>field1 - character
>field2 - numeric
>
>When I turn debugger on to check the value of lcSQLString, it equals to .NULL.
>
>Does anyone have an explanation for this? Or a better way?
>
>TIA,
>CARIE

Yes, you must use "NULL", not just NULL in your expression, because you want to add the text NULL, not the value NULL (which is why your whole expression ends up as NULL.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Reply
Map
View

Click here to load this message in the networking platform