Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

true/false to Yes/no SQL

Status
Not open for further replies.

moley

IS-IT--Management
Mar 26, 2002
95
GB
I running asp forms from sql database. All the columns which are bit (input from check boxes) are displaying true/ false. Is there a simple way to display the data in yes/no format in text box??

cheers

moley
 
for 0/1 in any queries use
CAST(bitvalues AS INTEGER) AS bitvalue

as far as yes no goes i'm afraid its replace replace
REPLACE(REPLACE(bitvalue,true,"yes"),false,"no")

pain.
 
for asp..
we wrote this function since vbscript doesnt have iif.

function iif(i_Expr, i_True, i_False)
if i_Expr then
iif = i_True
else
iif = i_False
end if
end function


ex:
sText = iif(bModel = True, "Yes", "No")

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top