CHITOWN Posted January 29, 2020 Share Posted January 29, 2020 Is there a way to write a sql query that contains a decimal column, currently set to 2 decimals, to give me results that the hundredths column doesn't end in zero and excludes .25, .75. For example, finding .35 but not .25 or finding .83 but not .80. Any select statement to find those records is what I am looking for as I have tried where cast(hours as decimal(10,2)) - hours > 0 but brings me back decimals ending in zero as well as .25 and .75. Thanks. Link to comment Share on other sites More sharing options...
dsonesuk Posted January 30, 2020 Share Posted January 30, 2020 Decimal and date time are not compatible, one works in divisions of 10 the other in divisions of 60. Is 1.25, 1 hour 25min or 1 hour 15mins. If you are dealing with time use YEAR(), MONTH() etc, to get true, less confusing, datetime value Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now