General information
Forum:
Microsoft SQL Server
I have a table having a field called 'answer' is Varchar. We need change all values to Int.
678 TO 678 (INT to INT don't change)
Y TO 1
N TO 0
5.56 TO 556 (Real to INT by time 100, this is price)
I used
questionresponse=
case
when isnumeric(answer)=1 then answer -- need change
when isnumeric(answer)=0 and answer= 'Y' then '1'
when isnumeric(answer)=0 and answer= 'N' then '0'
when isnumeric(answer)=0 and answer= '-' then '0'
end
The only thing is how can we figure out which one is real. Do we have the function to identify Int and Real like isreal?
Thanks
Jim
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only