General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Sergey,
Thanks for your quick response. I've had a look at the datepart function and understand what it is doing, but I'm unsure how to put that into my case statement. The attached is the case statement I had used previously:
declare EndDate datetime
set EndDate = '29-feb-2004'
select Claim_Reference, Claim_Registered_Date, EndDate,
CASE
WHEN overall_stat = "Outstanding"
AND dateadd(mm,-1,EndDate) <= Claim_Registered_Date
THEN "01 - Up to 1 Month"
The case statement continues for the following bandings:
1 to 2 Months
2 to 6 Months
6 to 12 Months
12 to 18 Months
Over 18 Months
How do I take this forward?
Cheers
Carolyn
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only