DATEDIFF problem

Hi, I am trying to write a case statement were I am comparing to dates to determine the result. I do not think I am using the datediff function correctly. I am hoping someone can take a look at my code and offer suggestions.

select
case
when
DATEDIFF(day, reportdate) - DATEDIFF(day,[Expected Close Date]) <=182)
then '6 months'
when DATEDIFF(day, reportdate) - DATEDIFF(day,[Expected Close Date])<=365)
then '12 months
else 'Rest'
end as timeframe
from dbo.wkly_report

Featured Post

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

by Mark Wills
Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server... So if you are the accidental DBA, or, simp…

INTRODUCTION:
While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…

This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg).
If you're looking for how to monitor bandwidth using netflow or packet s…