After spending a while sorting out the SQL for my query, it seems to be working, and is pulling back the information I want. However, when I try to output the query into a table, I end up with duplicate information in the cells (where multiple entries are allowed for the same record). I've tried to use additional output tags, grouping on the individual tables primary key, but it doesn't seem to help. I have also tried using <cflooop> tags, with no luck. Someone suggested that the query I'm using may not be what I need at all, but I'm not sure. Here is my query and the output of it that I'm using:
<!--- Pulls all of the current Significant Events --->
<cfquery name="GetEvents" datasource="SigEvents" dbtype="ODBC">
SELECT
E.EventID, E.EventDateStart, E.EventDateEnd, E.EventTitle,
E.EventURL,
P.PIR, P.EventID, P.PIRID, S.Studies, S.StudiesURL, S.EventID,
S.StudiesID,
A.Amplification, A.AmplificationURL, A.EventID, A.AmplificationID,
R.Rel_Prods, R.Rel_ProdsURL, R.EventID, R.Rel_ProdsID
FROM
(((Event AS E LEFT OUTER JOIN PIR AS P ON E.EventID = P.EventID)
LEFT OUTER JOIN Studies AS S ON E.EventID = S.EventID)
LEFT OUTER JOIN Amplification AS A ON E.EventID = A.EventID)
LEFT OUTER JOIN Rel_Prods AS R ON E.EventID = R.EventID
WHERE
EventDateEnd >= #CreateODBCDate(now())#
ORDER BY
E.EventDateStart, E.EventID, P.PIR, A.Amplification, S.Studies,
R.Rel_Prods
</cfquery>
<!--- opening of table cut for space --->
<!--- Output the results of the query --->
<cfoutput query="GetEvents" group="EventID">
<tr>
<td align="center">
<cfif DateCompare(EventDateStart, EventDateEnd) EQ 0>
<span class=cells>#DateFormat(EventDateStart, "dd mmm yy"
#</span>
<cfelseif DateCompare(EventDateStart, EventDateEnd, 'm') EQ 0>
<span class=cells>#DateFormat(EventDateStart, "dd"
# - #DateFormat
(EventDateEnd, "dd mmm yy"
#</span>
<cfelseif DateCompare(EventDateStart, EventDateEnd, 'yyyy') EQ 0>
<span class=cells>#DateFormat(EventDateStart, "dd mmm"
# -
#DateFormat
(EventDateEnd, "dd mmm yy"
#</span>
<cfelse>
<span class=cells>#DateFormat(EventDateStart, "dd mmm yy"
# -
#DateFormat
(EventDateEnd, "dd mmm yy"
#</span>
</cfif>
</td>
<td><a href="#EventURL#"><span
class=cells>#EventTitle#</span></a></td>
<td align="center"><cfoutput group="PIRID">
<cfset thedirectory = " <a href="#thedirectory#"><span
class=cells>#PIR#</span></a><br></cfoutput>
</td>
<td><cfoutput group="StudiesID"><a href="#CollectionsURL#"><span
class=cells>
#Studies#</span></a><br></cfoutput>
</td>
<td><cfoutput group="AmplificationID"><a href="#AmplificationURL#">
<span class=cells>#Amplification#</span></a><br></cfoutput>
</td>
<td><cfoutput group="Rel_ProdsID"><a href="#Rel_ProdsURL#"><span
class=cells>
#Rel_Prods#</span></a><br></cfoutput>
</td>
</tr>
</cfoutput>
I'd appreciate anyone's help on this.
cheers,
Nicole
<!--- Pulls all of the current Significant Events --->
<cfquery name="GetEvents" datasource="SigEvents" dbtype="ODBC">
SELECT
E.EventID, E.EventDateStart, E.EventDateEnd, E.EventTitle,
E.EventURL,
P.PIR, P.EventID, P.PIRID, S.Studies, S.StudiesURL, S.EventID,
S.StudiesID,
A.Amplification, A.AmplificationURL, A.EventID, A.AmplificationID,
R.Rel_Prods, R.Rel_ProdsURL, R.EventID, R.Rel_ProdsID
FROM
(((Event AS E LEFT OUTER JOIN PIR AS P ON E.EventID = P.EventID)
LEFT OUTER JOIN Studies AS S ON E.EventID = S.EventID)
LEFT OUTER JOIN Amplification AS A ON E.EventID = A.EventID)
LEFT OUTER JOIN Rel_Prods AS R ON E.EventID = R.EventID
WHERE
EventDateEnd >= #CreateODBCDate(now())#
ORDER BY
E.EventDateStart, E.EventID, P.PIR, A.Amplification, S.Studies,
R.Rel_Prods
</cfquery>
<!--- opening of table cut for space --->
<!--- Output the results of the query --->
<cfoutput query="GetEvents" group="EventID">
<tr>
<td align="center">
<cfif DateCompare(EventDateStart, EventDateEnd) EQ 0>
<span class=cells>#DateFormat(EventDateStart, "dd mmm yy"

<cfelseif DateCompare(EventDateStart, EventDateEnd, 'm') EQ 0>
<span class=cells>#DateFormat(EventDateStart, "dd"

(EventDateEnd, "dd mmm yy"

<cfelseif DateCompare(EventDateStart, EventDateEnd, 'yyyy') EQ 0>
<span class=cells>#DateFormat(EventDateStart, "dd mmm"

#DateFormat
(EventDateEnd, "dd mmm yy"

<cfelse>
<span class=cells>#DateFormat(EventDateStart, "dd mmm yy"

#DateFormat
(EventDateEnd, "dd mmm yy"

</cfif>
</td>
<td><a href="#EventURL#"><span
class=cells>#EventTitle#</span></a></td>
<td align="center"><cfoutput group="PIRID">
<cfset thedirectory = " <a href="#thedirectory#"><span
class=cells>#PIR#</span></a><br></cfoutput>
</td>
<td><cfoutput group="StudiesID"><a href="#CollectionsURL#"><span
class=cells>
#Studies#</span></a><br></cfoutput>
</td>
<td><cfoutput group="AmplificationID"><a href="#AmplificationURL#">
<span class=cells>#Amplification#</span></a><br></cfoutput>
</td>
<td><cfoutput group="Rel_ProdsID"><a href="#Rel_ProdsURL#"><span
class=cells>
#Rel_Prods#</span></a><br></cfoutput>
</td>
</tr>
</cfoutput>
I'd appreciate anyone's help on this.
cheers,
Nicole