Hi there,
I have a situation in which I need to do one thing if the values of a field ("ServiceCode") fall within the range of 100-299, and do something else if the value is outside this range. The problem is that ServiceCode field has a datatype of char(6), and there are some non-numeric values in that field.
So the logic needs to be:
If ServiceCode is a number datatype (int or decimal) AND ServiceCode is between 100 and 299, then <Do Something>
Else NULL
Additionally, this statement needs to be within a larger Select statement.
I.E.
SELECT
FIELD1,
FIELD2,
<LOGIC FROM ABOVE>,
FIELD4
FROM TABLE_X
WHERE <BLAH>
Any suggestions?
Thanks,
NWChowd
======================================
"I wish that I may never think the smiles of the great and powerful a sufficient inducement to turn aside from the straight path of honesty and the convictions of my own mind."
-David Ricardo, classical economist
======================================
I have a situation in which I need to do one thing if the values of a field ("ServiceCode") fall within the range of 100-299, and do something else if the value is outside this range. The problem is that ServiceCode field has a datatype of char(6), and there are some non-numeric values in that field.
So the logic needs to be:
If ServiceCode is a number datatype (int or decimal) AND ServiceCode is between 100 and 299, then <Do Something>
Else NULL
Additionally, this statement needs to be within a larger Select statement.
I.E.
SELECT
FIELD1,
FIELD2,
<LOGIC FROM ABOVE>,
FIELD4
FROM TABLE_X
WHERE <BLAH>
Any suggestions?
Thanks,
NWChowd
======================================
"I wish that I may never think the smiles of the great and powerful a sufficient inducement to turn aside from the straight path of honesty and the convictions of my own mind."
-David Ricardo, classical economist
======================================