Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF() Question
Message
De
20/05/1999 10:26:21
 
 
À
20/05/1999 09:23:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00220792
Message ID:
00220841
Vues:
24
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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform