I am trying to loop through all the months so that I can get a count of events
that occur for each month based on notification date. It is looping through, but I am not getting any records back. What am I doing wrong? I tried using LIKE instead of = in the WHERE clause but that did not work. I am using Oracle database.
Thanks in advance for your help,
olmos
<CFSET months = ArrayNew(1)>
<CFLOOP INDEX = "loopcount" FROM="1" TO="12">
<CFSET months[loopcount] = MonthasString(loopcount)>
</CFLOOP>
<CFLOOP index = "loopcount" FROM="1" TO="12">
<CFOUTPUT>
<CFQUERY NAME="events_by_month" DATASOURCE="#PrimaryDataSource#" >
SELECT count(id) as id_count
FROM event
WHERE notification_date = TO_DATE('#ucase(months[loopcount])# 2002', 'MONTH YYYY')
</cfquery>
#events_by_month2.id_count#
#months[loopcount]#<br>
</CFOUTPUT>
</CFLOOP>
that occur for each month based on notification date. It is looping through, but I am not getting any records back. What am I doing wrong? I tried using LIKE instead of = in the WHERE clause but that did not work. I am using Oracle database.
Thanks in advance for your help,
olmos
<CFSET months = ArrayNew(1)>
<CFLOOP INDEX = "loopcount" FROM="1" TO="12">
<CFSET months[loopcount] = MonthasString(loopcount)>
</CFLOOP>
<CFLOOP index = "loopcount" FROM="1" TO="12">
<CFOUTPUT>
<CFQUERY NAME="events_by_month" DATASOURCE="#PrimaryDataSource#" >
SELECT count(id) as id_count
FROM event
WHERE notification_date = TO_DATE('#ucase(months[loopcount])# 2002', 'MONTH YYYY')
</cfquery>
#events_by_month2.id_count#
#months[loopcount]#<br>
</CFOUTPUT>
</CFLOOP>