I need to do such a calculation.
(Get today's date - 219 - HISTSTARTDATE) / 7 AS 'Weeks Of History'
When I do it like this
(DATEDIFF(DAY,0,GETDATE()) - DATEADD(DAY, -219, GETDATE()) - HISTSTART) / 7 AS 'Weeks Of History'
I am getting an error which says 'The data types datetime and date are incompatible in the subtract operator.'
I am pretty confused because I believe it was working for me before. Does someone may have an idea what can be wrong and how to fix it?
Please let me know if you know.