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
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