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!
Red Flag Submitted
Thank you for helping keep Tek-Tips Forums free from inappropriate posts. The Tek-Tips staff will check this out and take appropriate action.
Reply To This Thread
Posting in the Tek-Tips forums is a member-only feature.