Find a MOnth

S

smason

hello i have a table which contains dates in the format 01/01/2007 these go
back over a few years, i want to query the table and get all the records with
february i them! i have formatted the dates to mmmm which give me january
february march and so forth but when i put the criteria in i.e. like feb i
get no results

any ideas!

thanks in advance
 
J

Jason Lepack

The month() function should do what you want.

SELECT * FROM yourtable WHERE month(yourDateField) = 2

But on another note when you formatted as "mmmm", "feb" does not equal
"February" which is why you got no results. If you wanted to match
"feb" to "Februrary" you would have to use Like "feb*"

Cheers,
Jason Lepack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top