Id like to do a select statement like this:
SELECT (case field when [^.]*.[^.]* then field else field+'.0') as field1
FROM table
this doesnt run and when I enclose the expression in apostrophes it just treats the expression like a string.
Basically I just want to check to see if a number is a whole number(no decimal point). If it is, I want to put a '.0' at the end of it. If it already has a decimal place, then I just leave it alone.
Im using SQL 2000 btw. In the examples I searched for online I didnt see reg expressions being used in a case statement.
SELECT (case field when [^.]*.[^.]* then field else field+'.0') as field1
FROM table
this doesnt run and when I enclose the expression in apostrophes it just treats the expression like a string.
Basically I just want to check to see if a number is a whole number(no decimal point). If it is, I want to put a '.0' at the end of it. If it already has a decimal place, then I just leave it alone.
Im using SQL 2000 btw. In the examples I searched for online I didnt see reg expressions being used in a case statement.