Question
datefield brings back wrong dates
Here is the code for the startdate datefield:
<cfinput type="datefield" name="startDate" label="Report Start Date" value="#LSDateFormat(form.startdate)#" width="100">
Here is the code for the enddate datefield:
<cfinput type="datefield" name="endDate" label="Report End Date" value="#LSDateFormat(form.enddate)#" width="100">
cfparam:
<cfparam name="form.startdate" default="">
<cfparam name="form.enddate" default="" >
Query:
<cfquery name="qGetattendance" datasource="mydsn">
SELECT students.firstname, students.lastname,
MIN(attendancedate) as startdate,
MAX(attendancedate) as enddate,
sum(fullday) AS AttendFullDay,
sum(halfday) as AttendHalfDay,
count(attendancedate) as dayCount,
sum(childrenbreakfast) as breakfastcount,
sum(childrenlunch) as lunchcount,
sum(children3pmsnack) as snackcount
FROM attendance, students
WHERE students.studentID = attendance.studentID and students.classroomID = 3 AND attendance.attendancedate > <cfqueryparam CFsqltype="CF_SQL_DATE" value="#form.startdate#"> and attendance.attendancedate < <cfqueryparam CFsqltype="CF_SQL_DATE" value="#form.enddate#">
GROUP BY students.lastname, students.firstname
ORDER BY lastname ASC</cfquery>
Any help is much appreciated.
Thank you.
Keann