First you would need to convert your dates to datetime with
dateadd(hour, HourCol, DateCol) and then you will be able to compare with
dateadd(hour,12,dateadd(day,-1+datediff(day,'20100101',getdate()),'20100101') -- this should give you previous day at noon
However, perhaps it makes sense to add persisted computed column to your table based on the above, index on it and use that column instead of functions if these types of queries are often enough.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.