I am trying to display a list of upcoming events grouped together by
month. So for example it would show


July 2004


23 Windows Course
25 Word Course


August 2004


10 Windows Course
15 Excel Course


etc......................


When running the query shown at the bottom of the email it works as it
should, however when adding the following to the WHERE clause


AND
courseoutline.id = iteccourse.courseoutlineid
AND
iteccourse.courseoutlineid ='1'

it displays the results like


July 2004


23 Windows Course


July 2004


25 Word course etc.........................

<cfset MonthsToDisplay = 2>
<cfset BeginDate = "#Month(now())#/1/#Year(now())#">
<cfset EndDate = "#Month(DateAdd("m",
MonthsToDisplay,now()))#/#DaysInMonth(DateAdd("m",
MonthsToDisplay,now()))#/#Year(DateAdd("m",  MonthsToDisplay, now()))#">


<cfquery name="getevents" datasource="in">
SELECT courseoutline.coursetitle, courseoutline.coursesummary,
courseoutline.coursepath, iteccourse.coursestart,
to_char(coursestart,'YYYY') AS eventYear, to_char(coursestart,'MM') AS
eventMonth, iteccourse.duration,
iteccourse.availability
FROM    courseoutline, iteccourse
WHERE     trunc(coursestart) BETWEEN
TO_DATE('#DateFormat(variables.Begindate,"dd/mm/yyyy")#','DD/MM/YYYY')
AND TO_DATE('#DateFormat(variables.Enddate,"dd/mm/yyyy")#','DD/MM/YYYY')
ORDER BY iteccourse.coursestart asc
</cfquery>


Any ideas on why this may be occuring ?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to