|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have an oracle table which has numeric data (1 or 0) in a field denoting true or false (yes or no). In my SQL query that I use to get the data, I need to also convert the 1 to "yes" and 0 to "no". Can I use to_char to do this and how or if not what other solutions are there. Thank you in advance for any help.
|
|
#2
|
||||
|
||||
|
Code:
If(rs("fieldName") = 1) Then
value = "yes"
Else
value = "no"
End If
|
|
#3
|
|||
|
|||
|
Alternatively, I use this in a mysql sql query, generating a resultset (java), where floating_control is parameter:
if(floating_control=0,'OFF','ON') I can then use the data object as a string with YES or NO, with no need to convert it in code.... Good luck |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Convert Numeric Data To Yes/No |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|