Select dates for this month
Hi all,
I'm creating a calendar output for a site and I've run into a problem with my query. When the page loads, CF sets now() to "Today." What I'm trying to do is pull all the dates from a db table for the current month based on now(). I keep getting the "too few parameters expected" error. Would someone mind looking at my code to see if they can find an issue?
<cfset Today = "#Dateformat(now(), "MM/DD/YYYY")#">
<cfquery name="GetEvents" datasource="DataS">
SELECT StartDate,EndDate,Event,Description,Place,StartTime,EndTime,AllDay,AllMonth,HmPg,Ongoing
FROM CalendarData
WHERE #DatePart("m", Today)# = #DatePart("m", StartDate)#
AND StartDate >= #Today#
AND HmPg = 1
ORDER BY StartDate ASC, StartTime ASC
</cfquery>
I have a similar query in another area of the site, but the WHERE clause reads WHERE #DatePart("m", StartDate)# = #CalMonth# where CalMonth is set to a number depending on which month a user clicks on. I want the query above to update dates for each month automatically.
Thank you!
