-
SQL conditional IF, help with
Working with MSAccess2000
SELECT (IIf(paybycheck.anonym=1, "anonym", paybycheck.name)) AS name,
city,state,amount,checkdate,anonym
FROM paybycheck
WHERE fund = '#tpcid#'
group by name,city,state,amount,anonym,checkdate
order by name asc
</CFQUERY>
returns "-1" instead of the word "anonym" AS name
I have also tried
SELECT
case when paybycheck.anonym=1 then 'anonym' else paybycheck.name end AS name
FROM paybycheck
WHERE 1=1
and this
SELECT
CASE paybycheck.anonym
WHEN 1 then 'anonym'
WHEN 0 then paybycheck.name
END as name
FROM paybycheck
WHERE 1=1
and a host of variations, at no avail.
These last two, keeps generating the "missing operator in query espression" error. (in ColdFusion)
Any thought?
-
Did you try this
SELECT 'Name' =
CASE paybycheck.anonym
WHEN 1 then 'anonym'
WHEN 0 then paybycheck.name
END
FROM paybycheck
WHERE 1=1
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|