Outputting and grouping records in multiple column format issue
Hi All,
I am banging my head off the wall with this one. I have a query that displays the output in a two column format, it works great.
I run into an issue when I try to use "group' so the field DSC1 does not show duplicates. It turns the output into 2 column, 3 column and 4 column with blank spots throughout.
Anybody know how I can get it to display 2 columns of output and not show duplicate DSC1 fields? Here are examples of what happens:
Example 1 of what it does without group (note apples is twice, can't have that) :
apples apples
oranges peaches
banannas grapes
What I need to do (only show each DSC1 once and continue with the two column format):
apples oranges
peaches banannas
grapes
Here is the coding I am using:
<cfquery name="getProduct" datasource="mydb">
SELECT * FROM ecitm
WHERE DSC1 <> ' '
order by DSC1
</cfquery>
<!---start the table to output 2 columns of data--->
<table border="0" width="90%" border="0" align="center" cellpadding="5" cellspacing="5">
<cfset newrow = false
<tr>
<cfoutput query="getProduct" group="DSC1">
<cfif newrow EQ "true">
<tr>
</cfif>
<td>
#DSC1#
<cfif DSC2 NEQ "">
<br>
#DSC2#
</cfif>
<br>
<a href="DetailsList.cfm?ID=#getProduct.ID#&litm=#getProduct.LITM#">VIEW DETAIL</a>
</td>
<cfif getProduct.currentRow MOD 2 EQ 0>
</tr>
<cfset newrow = true>
<cfelse>
<cfset newrow = false>
</cfif>
</cfoutput>
</tr>
</table>
