SELECT * WHERE month = March

danb

Registered User.
Local time
Today, 17:18
Joined
Sep 13, 2003
Messages
98
Hi,

I've got a news table in an Access database, with the following fields/datatypes:

Code:
=====
tblNews
=====
news_id (auto number)
news_headline (text field)
news_article (memo field)
news_date (date field)

I have a select statement from an ASP page like so:

Code:
SELECT * FROM tblNews ORDER BY news_date DESC;


What I need to be able to do, is to select all news articles from a particular year or all articles from a particular month, so the above statement needs to be something like this:

Code:
SELECT * FROM tblNews WHERE news_date = 'March' ORDER BY news_date DESC;

Clearly the above code doesn't work, since I'm passing a string into a date field, but this is the kind of thing I need to achieve.

Can this be done, and if so, how?

Thanks for any pointers...
 
WHERE Month(news_date) = 3
 
Perfect, that's just what I was looking for, thanks!
 
you nedd to check for the year as well as searching for month will Select Mar 89 Mar 90 etc....
 

Users who are viewing this thread

Back
Top Bottom