There can be situations where you want to check whether a field is a numeric or not. SQL Server provides ISNUMERIC() function to achieve that purpose as shown below.
then cast(cmp as int)
else 0 end FROM Transactions)
This can be easily included in a where clause as follows
Samitha
SELECT case when IsNumeric(cmp) = 1
then cast(cmp as int)
else 0 end FROM Transactions)
This can be easily included in a where clause as follows
select * from
Transactions
where (case when IsNumeric(
cmp) = 1
then cast(
cmp as int)
else 0 end) >= 7
CheersSamitha
No comments:
Post a Comment