Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Time difference in Calendar Month
Message
De
08/03/2004 12:24:25
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00884020
Message ID:
00884139
Vues:
11
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform