shole shole - 4 months ago 13
SQL Question

T-SQL select row if one specific column's decimal part is not 0

I have a table with one of the columns :

, it is of decimal type with 2 d.p.

Now I would like to select all rows from this table where
's decimal part is not 0

For example, I do not select the row if
is 150.00 or 222.00, but would like to select if
is 0.20 or 123.12, etc.

How can this be done in a single select query?


For rows where there is a zero decimal part Floor(cost) will equal cost and it won't where there is a non zero decimal part.

FROM YourTable
WHERE Floor(cost) <> cost;