First, check how many records are returned by the query against the
database to make sure your query is returning the correct results.
Second, in general the group attribute of the cfoutput tag should
match the ORDER BY clause in the query. So if you want to group by
netid then you should have ORDER BY netid, publication_date or it
won't work they way you want. I don't think you need group =
"citation" based on your description. Your inner-most cfoutput tag
generally will not have any group attribute.
Good luck,
Mike Chabot
On Jan 23, 2008 3:35 PM, Adam Parker <[EMAIL PROTECTED]> wrote:
> Hello -
>
> I have a query that runs once a form element is defined. The element is the
> submit button. when the query runs, I want it to output the results by
> faculty member with all citations listed under the faculty member. what is
> occurring is the name will be displayed and then the citations as I want,
> however, the query will them proceed to assign all other people in the
> directory to the selected faculty member's citations. A faculty member's
> eight citations turn into over 50K records being displayed.
>
> This is the query that runs if the form element is defined:
> **************************************
> <cfif isDefined("form.findPublication")>
> <cfquery name="qGetPublications" datasource="myDSN">
> SELECT P.AUTHOR1, P.AUTHOR2, P.AUTHOR3, P.AUTHOR4, P.AUTHOR5, P.AUTHOR6,
> P.AUTHOR7, P.AUTHOR8, P.PUBLICATION_DATE, P.PUBLICATION_NAME, P.PUBLICATION,
> P.CITATION, P.DISCIPLINE, D.NETID, D.LASTNAME, D.FIRSTNAME, d.
> classification, z.id, z.discipline
>
> FROM dbo.KSBDirectory AS D,
> DBO.PUBLICATIONS AS P,
> DBO.DISCIPLINE AS Z
>
> WHERE (p.author1=d.netid)
> and (d.discipline=z.id)
> AND (P.DISPLAY='true')
> and (d.classification <> 'staff')
> And (0=0)
>
> <cfif (faculty is not "0")>
> and (d.netid = '#form.faculty#') OR (P.AUTHOR2 =
> '#form.faculty#') OR (P.AUTHOR3 = '#form.faculty#') OR (P.AUTHOR4 =
> '#form.faculty#')
> OR (P.AUTHOR5 = '#form.faculty#') OR (P.AUTHOR6 = '#form.faculty#') OR
> (P.AUTHOR7 = '#form.faculty#') OR (P.AUTHOR8 = '#form.faculty#')
> </cfif>
>
> <cfif (discipline is not "0")>
> AND p.discipline = '#form.discipline#'
> </cfif>
> <cfif (pubYear is not "0")>
> AND p.publication_date = '#form.pubYear#'
> </cfif>
>
>
> ORDER BY publication_date desc
> </cfquery>
>
> </cfif>
> ********************************
> This is the output to display the data:
> ********************************
>
> <cfelseif isDefined ("form.findPublication") and ("form.faculty") is not "0"
> and ("form.discipline") is not "0" and ("form.discipline") is not "0">
> <h4>Available Publications</h4>
> <cfif qGetPublications.recordcount gte
> 1>
> <ul>
> <p>
> <cfoutput query="qGetPublications"
> group="netid">
> <p><a
> href="facultyProfile.cfm?netid=#netid#">#lastname#, #firstname# </a><br />
> <cfoutput
> group="citation"><em>#citation#</em><br /><br /></cfoutput></p>
> </cfoutput>
> </p>
> </ul>
> <cfelse>
> <p>No publications meet your
> criteria.</p>
> </cfif>
> </cfif>
>
> I suspect the "group" attribute in cfoutput may be to blame?
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3245
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15