General information
Category:
Coding, syntax & commands
Thanks, guys. That worked beautifully.
CARIE
>Any expression with a NULL will result as NULL.
>Ex.: ? "Test" + NULL && Print NULL
>
>Here is what you should do:
>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)))+")"
>
>Notice the "" around the NULL.
>
>HTH
>
>>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?
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only