I have to generate and insert a record for each day in a
series of date ranges. I am passign some values from a form and
trying to insert them for each day.
Here is my code:
<cfquery name="datetest" datasource="ds">
SELECT '#form.building#' AS BldgArea, #form.semcode# AS
Semester, DateAdd('d', DaysSpan.Counter, '#form.firstday#') AS
SchedDt, DaysSpan.Counter AS Expr1
FROM DaysSpan
WHERE ((DateAdd('d', DaysSpan.Counter, '#form.firstday#'))
<= '#form.lastday#')
</cfquery>
So I have a table with a a field called counter which has
rows 0 - 366. I want to get a firstday and increment that date by 1
until it reaches the lastday then stop.
I run the page and i am not getting any errors, but nothing
is being output. When I take the where clause out it works fine and
output 365 days of dates starting with my firstday. I am only going
by semester though so I only want the days in between firstday and
lastday output.
Any ideas?