waiting12345
Technical User
Hi, I'm doing an events calendar and I need to select all the events from the database where the events takes place in the current month. My problem lies in that I have a start date and end date. Here's what I've got so far:
SELECT * FROM dbo.qryEventsPlusFE WHERE month(fldStartDate) <= month(getdate()) AND year(fldStartDate) <= year(getdate()) AND month(fldEndDate) >= month(getdate()) AND year(fldEndDate) >= year(getdate())
but it does not select the records where the month of the start date is < current month and the month of the end date is > current month.
I'd appreciate it if someone could help. Thanks
SELECT * FROM dbo.qryEventsPlusFE WHERE month(fldStartDate) <= month(getdate()) AND year(fldStartDate) <= year(getdate()) AND month(fldEndDate) >= month(getdate()) AND year(fldEndDate) >= year(getdate())
but it does not select the records where the month of the start date is < current month and the month of the end date is > current month.
I'd appreciate it if someone could help. Thanks