Link to home
Start Free TrialLog in
Avatar of TECH_NET
TECH_NET

asked on

Check the value of a decimal type column

I have a SQL table column X which hold a data type varchar2

I have the table populated with some records.

and the data looks like

21.98
23.87
34.12 OFF
12.23

etc

I want to find the row that does not hold a value price. How can i find it.
I need the row 34.12 OFF to be retrieved for the illustration.
Avatar of Chris Mangus
Chris Mangus
Flag of United States of America image

Select X From myTable where IsNumeric(X) = 0

This will catch any non numeric rows.
Avatar of TECH_NET
TECH_NET

ASKER

It works great. Exactly what i wanted. Now another question.

one of the value of the price column was

Skil 7.2-volt Lithium-Ion Power Wrench -

How can i update the another column Y, with the value of the PRICE, and if the column Y has a value , can i append the value of the PRICE column to value of column Y.

I increased the points to 500
Update myTable Set Y = IsNull(Y, '') + IsNull(X, '')
Where IsNumeric(X) = 0

The IsNulls are there to catch any instance where you don't have an existing value in Y or in the event the data in column X is null.
My code will update all of your Y columns.  Are you wanting to do this on a row-by-row basic?
yes, i want to update only rows where the column of price is not numeric,
ASKER CERTIFIED SOLUTION
Avatar of Chris Mangus
Chris Mangus
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your quick responses.