>Wow, old code... Before I even attempt to answer the question. What version >of ColdFusion are you running this on? > >The reasons I ask are as follows: > >ParameterExists has been deprecated since version 4/4.5 or thereabouts. - >use isDefined or even better, StructKeyExists instead. > >Code like this: > ><cfif #endnum# GT #count#><cfset endnum = #count#></cfif> > >Can and should be written like this > ><cfif endnum GT count> > <cfset endnum = count> ></cfif> > >and > ><cfset count=#count#+1> > >Should read at least as <cfset count = count + 1> and if you have CF8 you >could use the new ++ operator :-) > >Now onto answering your question... > >It appears the critical part of your code is missing from your post. I >cannot see the <cfquery> that actually retrieves the documents from the >database > ><cfquery name="getDocs" ...> > >Without seeing that (which is most likely where the logic error is), it's >almost impossible to answer this question. > >Yours > >Paul
Paul, Here is the query: I'm using version MX which i think is 5; thanks <cfquery datasource="#data#" name="getdocs"> SELECT * FROM docs LEFT OUTER JOIN DocActionLog DAL ON docs.docID = DAL.DocID and DAL.EmployeeID = #session.EmployeeID# and DAL.ActionType = 'R' WHERE docResponseID = '#getDept.DeptResponsibleID#' <cfif parameterexists(docType)>AND docTypeID in (#PreserveSingleQuotes(docType)#)</cfif> <cfif parameterexists(startsWith)>AND <cfif #startsWith# is "0"> (docTitle between '0' AND 'A') <cfelseif #startsWith# is "A"> (docTitle between 'A' and 'E') <cfelseif #startsWith# is "E"> (docTitle between 'E' and 'I') <cfelseif #startsWith# is "I"> (docTitle between 'I' and 'M') <cfelseif #startsWith# is "M"> (docTitle between 'M' and 'Q') <cfelseif #startsWith# is "Q"> (docTitle between 'Q' and 'T') <cfelseif #startsWith# is "T"> (docTitle between 'T' and 'W') <cfelseif #startsWith# is "W"> (docTitle > 'W') <cfelse> docTitle IS NOT Null </cfif> </cfif> <cfif parameterexists(orderBy)>ORDER BY #orderBy# <cfelse>ORDER BY docTitle</cfif> </cfquery> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292131 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4