...not a SQL function in how you meant it anyway. I believe IIF() IS a
function in MS Access... that has been many years for me though.

.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com

-----Original Message-----
From: Bobby Hartsfield [mailto:bo...@acoderslife.com] 
Sent: Saturday, March 19, 2011 7:04 AM
To: cf-talk
Subject: RE: Converting Boolean in the query


IIF() is not a sql function, it is a CF function. You will need something
like this instead...

Select case when myBitFiled=1 then 'Yes' else 'No' end as myBitField 
from table

.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com


-----Original Message-----
From: Kevin Parker [mailto:tras...@internode.on.net] 
Sent: Saturday, March 19, 2011 1:19 AM
To: cf-talk
Subject: Converting Boolean in the query


Appreciate a little bit of advice please.

I am creating a small bit of script to dump some data to a csv file. I want
to convert a Boolean field to a Yes or No inside the query.

I've used this technique in my SELECT statement from scouring the net.

IIF(PractitionerNews, 'YES', 'NO') AS MyConvertedField

However, this returns an error...

 [Macromedia][SQLServer JDBC Driver][SQLServer]'IIF' is not a recognized
built-in function name.

The box is running CF8 and SQL 2005.

Is this the recommended approach in CFML or is there a better way.

TIA!!!!!

++++++++++
Kevin Parker
++++++++++









~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343136
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to