comparing dates
comparing dates
(OP)
I am trying to compare dates. I want to pull out all records that fall within a given month and year. For example: Say I want to pull out all records for 3/02(March of 2002). How can I get it to ignore the day part of the date? This is for an "event search" so I have start dates and end dates for each event. I want to be able to search for all events happening in a certain month. I have tried using cast with wildcards in the day part of the date but it doesn't like that.
This is something like I need but it doesn't work:
SELECT *
FROM EVENTTABLE
WHERE CAST('month/*/year' AS DATE) BETWEEN STARTDATE AND ENDDATE
Any help is greatly appreciated!
Thanks
This is something like I need but it doesn't work:
SELECT *
FROM EVENTTABLE
WHERE CAST('month/*/year' AS DATE) BETWEEN STARTDATE AND ENDDATE
Any help is greatly appreciated!
Thanks
RE: comparing dates
SELECT *
FROM EVENTTABLE
WHERE STARTDATE between '2/28/2002' AND '4/1/2002'
or
SELECT *
FROM EVENTTABLE
WHERE STARTDATE = '3/2/2002'
S. van Els
SAvanEls@cq-link.sr