Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to decide the how many days in each period
Message
 
 
À
19/03/2003 11:39:28
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00767625
Message ID:
00767630
Vues:
14
See DATEDIFF() function and use self-join.

>I have a table like this.
>FY     PD        PD_END_DT           DAYS IN PD
>------ ------ ---------------------------
>2002   1      Jan 31 2002 12:00AM         ?
>2002   2      Feb 28 2002 12:00AM
>2002   3      Mar 31 2002 12:00AM
>2002   4      Apr 30 2002 12:00AM
>2002   5      May 31 2002 12:00AM
>2002   6      Jun 30 2002 12:00AM
>2002   7      Jul 31 2002 12:00AM
>2002   8      Aug 31 2002 12:00AM
>2002   9      Sep 30 2002 12:00AM
>2002   10     Oct 31 2002 12:00AM
>2002   11     Nov 30 2002 12:00AM
>2002   12     Dec 31 2002 12:00AM
>2003   1      Jan 31 2003 12:00AM
>2003   2      Feb 28 2003 12:00AM
>2003   3      Mar 31 2003 12:00AM
>I want to find how many days in each period. How can I use SQL to do this?
>
>
>Thanks
>
>
>Jim
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform