Weird "IIF" problem  
Author Message
dmatthew





PostPosted: Visual FoxPro General, Weird "IIF" problem Top

Hi,

I seem to be getting a problem running the IIF statement using this particular code:

"iif(((maturity)-(m.dday1)) between 365 and 730, 1, 0) as TERM"

Basically Foxpro is saying that I'm missing a comma in this particular line of code. However, I can't seem to figure out where to place the comma.

Thanks in advance!



Visual FoxPro1  
 
 
Alex Feldstein





PostPosted: Visual FoxPro General, Weird "IIF" problem Top

IIF() is an XBASE command. You are mixing with the BETWEEN SQL construct.

Try using the BETWEEN() xbase function instead:

Iif(Between(maturity-m.dday1,365,730),1,0)


 
 
dmatthew





PostPosted: Visual FoxPro General, Weird "IIF" problem Top

thanks so much! works like a charm! :)