: Monday, August 29, 2005 3:40 PM
To: CF-Talk
Subject: RE: Oracle SQL alternative for YesNoFormat() ?
I haven't messed with Oracle much but if you don't find a better solution,
you can hack something up that returns the length of the value minus 2 which
will return 1 for yes and 0 for no
This should do
This should do it (depending on the db)...
SELECT CASE WHEN field = 1 THEN 'YES' ELSE 'NO' END AS yesNoField
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 31, 2005 12:23 PM
To: CF-Talk
Subject: RE: Oracle SQL alternative for YesNoFormat
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Bobby,
This doesn't work for me because the values in the database
are in a numeric column and stored as 1 or 0. I need the
query to return 'yes' or 'no'. The query results are used
for a CFINDEX, so the only option I can think of at
select case when column_name = 0 then 'no' else 'yes' end as
column_name_yes_no_format
--Ferg
[EMAIL PROTECTED] wrote:
Bobby,
This doesn't work for me because the values in the database are in a numeric
column and stored as 1 or 0. I need the query to return 'yes' or 'no'. The
query
:[EMAIL PROTECTED]
Sent: Wednesday, August 31, 2005 11:33 AM
To: CF-Talk
Subject: RE: Oracle SQL alternative for YesNoFormat() ?
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Bobby,
This doesn't work for me because the values in the database
are in a numeric column and stored as 1 or 0
I havent messed with Oracle much but if you don't find a better solution,
you can hack something up that returns the length of the value minus 2 which
will return 1 for yes and 0 for no
This should do it...
select len(YesNoField)-2 as YesOrNo
from MyTable
if the values in that field are only
I havent messed with Oracle much but if you don't find a better solution,
you can hack something up that returns the length of the value minus 2 which
will return 1 for yes and 0 for no
This should do it...
select len(YesNoField)-2 as YesOrNo
from MyTable
if the values in that field are only
7 matches
Mail list logo