Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The Last Day of the Month
Message
 
To
17/01/2001 11:09:51
GW Gross
{Banned by Information Security Policy}
Lake Mary, Florida, United States
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00464689
Message ID:
00464760
Views:
14
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform