convert Access query iif to SQL statement

  • I want to convert Access query iif to SQL statement but got errors:

    IIf(#TUploadTo.WCFComplete=True,'WC','WI') AS Result

    How to convert it?

  • try the CASE statement (see BOL)

    if you are still having problems please post back.

    regards gah

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • case #TUploadTo.WCFComplete

    when 1 then 'WC'

    else 'WI'

    end as result

    I got multi-part idendifier "#TUploadTo.WCFComplete" could not be bound error

  • If you can provide the whole query I suspect that someone could help you solve this problem. (My guess is that you have given an alias to the #TUploadTo table, and if you do that you have to use the alias in the SELECT portion of you statement.)

  • CASE WHEN TUploadTo.WCFComplete = 1 THEN 'WC' ELSE 'WI' END AS result

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply