Friday, February 24, 2012

can someone help me construct a SQL command....

My head hurts...it might be an easy one for many people, but cant seem to figure a way to do it.
Ok, I have a table with a field called Ad_Price. This field is a nvarchar one, theres many different value in it, all of them corresponding to a price.
Now, what I want to do is only get the row that are not written in a good price format (like123$ is wrong, but 123.00 is good, but only value following this exemple)

For exemple, if I have all these value
145.87
6785.34
654$
45 to negociate
1bvcaa
0.01
876.556
the value I want to have are:
654$
45 to negociate
1bvcaa
876.556
because they dont follow the format I want
so im not sure if my explication was clear enough..all in all what I want to complete is the WHERE part of my SQL instruction...what should I put in:
SELECT *
FROM Ads
WHERE ???
thansk for taking the time to read this
Hello !!

You can try this:
SELECT Ad_PriceFROM Ads
WHERE Ad_PriceNOT LIKE'%[.][0-9][0-9]'
|||argh, its so simple...I hate myself when I ask something and the answer is so obvious:(...with a little tweak fto satisfy my need, this SQL instruction will be perfect to solve my problem. Thanks a lot for your quick help

No comments:

Post a Comment