I am trying to know week difference between two dates. It looks like SQL server do round off and gives the different result for me. But I want to calculate if they crossed 7, 14, 21 days.
I have stored a week difference in a database as like 1 or 2, etc. So I would like to use DATEDIFF with WEEK without round off.
Expected Result 0, But returns 1
SELECT DATEDIFF(WEEK, '2014-07-08 10:15:00', '2014-07-14 09:00:00'); --1
Expected Result 1, But returns 2
SELECT DATEDIFF(WEEK, '2014-07-08 10:15:00', '2014-07-20 09:00:00'); --2
Also same problem with MONTH, expected behaviour for below is 0. But gives 1
SELECT DATEDIFF(MONTH, '2014-07-15 10:15:00', '2014-08-12 09:00:00') --1
How can I get the correct week/month difference?