I have a query as follows:
<CFELSEIF (#URL.issueStatus# NEQ 'All') AND (#URL.ccNumber# NEQ 'All')>
<cfquery name="getIssues" datasource="pd" dbtype="ODBC">
SELECT tblProjectIssues.issueNumb
er,
tblProjectIssues.ccNumber,
tblProjectIssues.issueStat
us,
tblProjectIssues.issueDate
Opened,
tblProjectIssues.issueShor
tDescripti
on,
tblProjectIssues.issueLong
Descriptio
n,
tblProjectIssues.issueDate
Closed,
tblProjectIssues.issueOwne
r,
tblProjectIssues.issuePrio
rity,
tblProjectIssues.issueDueD
ate,
tblProjectIssues.issueComm
ents,
tblIssuesComments.enteredD
ate,
tblIssuesComments.Comment,
tblIssuesComments.whoUpdat
e
FROM tblProjectIssues
RIGHT JOIN tblIssuesComments ON tblProjectIssues.issueNumb
er = tblIssuesComments.issueNum
ber
WHERE tblProjectIssues.issueStat
us = '#URL.issueStatus#' AND
tblProjectIssues.ccNumber = '#URL.ccNumber#'
ORDER BY
tblProjectIssues.#URL.Sort
#,
tblProjectIssues.ccNumber,
tblProjectIssues.issueStat
us;
</cfquery>
</CFIF>
========================
The elements in tbltblProjectIssues is 1 to many with tblIssuesComments. In otherwords - I have many tblIssuesComments associated with one tblProjectIssues.
My problem is in my CFOUTPUT - the tblProjectIssues gets repeated for each row when the tblIssueComments are more than one. How can I suppress so that the tblProjectIssues does not get rendered on the web-page?
Also need to be able to handle when there is no related comment with the Issue Number - else my current query does not work.
I realize this is difficult to understand - so please ask questions if you do not follow.
Regards -
Start Free Trial