Click to See Complete Forum and Search --> : SQL statement for specific month


usin
April 5th, 2001, 01:05 AM
hello,

is there any way to retrieve for records that the datefield match only the specific month of a year.

for example:
if I want to retrieve the expenses record that occur in the month of january.

really need your help.

best regard usin.

czimmerman
April 5th, 2001, 02:40 AM
In SQL Server,

SELECT * FROM MYTABLE WHERE DATEPART(mm, MYDATEFIELD) = 01

usin
April 5th, 2001, 02:47 AM
thank you very much.

i have rated you excellent.


usin.

Iouri
April 5th, 2001, 07:04 AM
Also you can use
select * from table where Month(YourDate) = 05

Iouri Boutchkine
iouri@hotsheet.com