Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF character length?
Message
From
03/06/2002 08:25:13
 
 
To
03/06/2002 08:14:51
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00663995
Message ID:
00664001
Views:
20
In your IIF,instead of returning an empty string, return a string of 10 chars. For example:

IIF(empty(a.dtchange),"'" + SPACE(10) + "'","'" + DTOC(a.dtchange) + "'") as DTCHANGE

Mace

>I'm using the following statement in SQL: (VFP 5.0, selecting from a foxpro database.)
>
>select a.citat as TICKUPD, IIF(a.pflag=.t.,"T","F") as CASE_FLAG, IIF(a.acc=.t.,"Y","N") as ACC, ;
>a.chem, IIF(empty(a.dtrefu),"''","'" + DTOC(a.dtrefu) + "'") as DTREFU, ;
>IIF(empty(a.dtdisp),"''","'" + DTOC(a.dtdisp) + "'") as GFC_DDATE, ;
>IIF(INLIST(a.DISPO,"1","2","7"),a.DISPO,"") as MAST_DISPO, ;
>IIF(empty(a.dtcompl),"''","'" + DTOC(a.dtcompl) + "'") as DTCOMPL, ;
>a.MECOMPL, ;
>IIF(a.CANID=.t.,"Y","N") as CANID, IIF(empty(a.dtsent),"''","'" + DTOC(a.dtsent) + "'") as DTSENT, ;
>IIF(empty(a.dtadd),"''","'" + DTOC(a.dtadd) + "'") as DTADD, ;
>IIF(empty(a.dtchange),"''","'" + DTOC(a.dtchange) + "'") as DTCHANGE, b.tick_num from mevmast
>
>For some reason, the results it is giving me for the date fields DTCOMPL, DTSENT, DTADD and DTCHANGE are coming out as two characters long-- i.e. if the date value is 02/05/1999 the result of the IIF seems to become '0
>If it is 11/15/2000 it becomes '1
>And so on. However, the GFC_DDATE IIF which is written identically works fine. Any ideas?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform