Saturday, May 19, 2012   
 Search   
 

http://www.foxfirereporting.com
Register  Login  
Forums  
      
 Forums    
SearchForum Home
  Support  Foxfire! 6.0x Support  IIF with the Li...
 IIF with the Like operator
 
 10/24/2011 1:33:29 AM
cinyv
1 posts


IIF with the Like operator

Please let me know what is wrong with the below query. I get a message saying function is missing a comma.

SELECT ALL;
        XPAT.PAT_ID                    AS PAT_ID_X,;
        IIF(XPAT.TMPATINFO like '4000%', XPAT.PAT_ID, XPAT.TMPATINFO),;
        XPAT.TMPATINFO                 AS XTMPATINFO;
  FROM "XPAT" XPAT;
  INTO CURSOR EA_T

 10/28/2011 2:09:16 AM
AndrewM
149 posts
www.aksel.com
5th


Re: IIF with the Like operator
What database are you running this against?

It looks like VFP but you can't use LIKE as part of the IIF function.

Instead try


IIF(XPAT.TMPATINFO ='4000', XPAT.PAT_ID, XPAT.TMPATINFO),;

In VFP queries, the = works the same as "like" as long as Set Exact is off.
  Support  Foxfire! 6.0x Support  IIF with the Li...
   
SearchSearch  Forum HomeForum Home     
 Links    
   
  
Downloaded from DNNSkins.com