Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Last Day of the Month
Message
 
À
17/01/2001 11:09:51
GW Gross
{Banned by Information Security Policy}
Lake Mary, Floride, États-Unis
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00464689
Message ID:
00464760
Vues:
15
>Ok, this should probably be easy, but I seem to be making everything hard these days. I know the month, but I want to know what the last day of that month is. I am provided the month, but I want to build an SQL statement that extracts everything that has a date in that month. The only way I know how to do it is:
>
>Select * From TableName Where CreationDate >= #1/1/2001# and CreationDate <= #1/31/2001#
>
>Any ideas or suggestions?
>
>Thanks

Hi,

You may try the statement below:
Select * From TableName Where Month(CreationDate)=1;

You may doublecheck if year is also important, if yes try the following statement:
Select * From TableName Where Month(CreationDate)=1 AND Year(CreationDate)=2001;

HTH, Igor
Igor Gelin
Database Developer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform