There must be a way to do this...but it escapes me:
I have this query:
<cfquery name=get datasource=#dsn#>
SELECT p.projectID, p.projectname, p.userID, p.startdate, p.totalrevenue,
p.probability, co.contactID, co.fname, co.lname, co.email, co.businessphone,
cl.company, cl.clientID
FROM projects p RIGHT JOIN (contacts co INNER JOIN clients cl ON cl.clientID
= co.clientID) ON p.clientID = co.clientID
WHERE cast(p.userID as varchar) in (#rep#)#preservesinglequotes(string1)#
GROUP BY p.projectID, p.projectname, p.userID, p.startdate, p.totalrevenue,
p.probability, co.contactID, cl.clientID, co.fname, co.lname, co.email,
co.businessphone, cl.company
ORDER BY p.userID
</cfquery>
I'm using maxrows/startrow to paginate the results....
The problem is: I'm sorting on projectID...but there can be multiple contact
records for each project one....
SO, <cfoutput query=get group=projectID startrow=#thisstartrow# maxrows=25>
will give me 25 rows, but that may only be 18 projects....and the numbering
scheme is thrown off all down the line....
currentrow counts ALL the returned rows....is there a reasonably easy way to
tell how many of the *group* records there are....and figure maxrows and
startrows from that?
TIA!!
D
___________________
Diana Nichols
Webmistress
SalesThreads - Selling Simplified
http://www.salesthreads.com
'One man's magic is another man's engineering' --Lazarus Long
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists