Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Time difference in Calendar Month
Message
 
 
To
08/03/2004 12:24:25
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00884020
Message ID:
00884152
Views:
10
Carolyn,

Is EndDate always the end of the month? If it's not how do you define a calendar month in this case?

>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
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform