A really quick fix is simply to change it to:

<cfquery name="qryGetApp" datasource="ITDATA">
SELECT  *
FROM    qryCHECKOUT
WHERE <cfloop list="#form.appid#" index="h">
                AppID = #h#
          <cfif qryDetails.recordcount is not qryDetails.currentrow>
        <cfoutput>or </cfoutput>
        </cfif>
        </cfloop> 1=1
        AND CheckIn IS NULL
        ORDER BY AppName, AppVersion DESC
        </cfquery>


note the "1=1" in there...  it's a hack, but it helps you avoid confusing
ColdFusion code in the query.

> -----Original Message-----
> From: Jones, Becky [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 27, 2001 5:00 PM
> To: CF-Talk
> Subject: loop question
>
>
> my query below keeps putting an OR after the last appid.
> how can i fix that?
> thanks,
> bec.
> <cfquery name="qryGetApp" datasource="ITDATA">
> SELECT        *
> FROM  qryCHECKOUT
> WHERE <cfloop list="#form.appid#" index="h">
>               AppID = #h#
>         <cfif qryDetails.recordcount is not qryDetails.currentrow>
>       <cfoutput>or </cfoutput>
>       </cfif>
>       </cfloop>
>       AND CheckIn IS NULL
>       ORDER BY AppName, AppVersion DESC
>       </cfquery>
>
>
> *************************************************
> This e-mail, including any attachments, is intended for the
> receipt and use by the intended addressee(s), and may contain
> confidential and privileged information.  If you are not an intended
> recipient of this e-mail, you are hereby notified that any unauthorized
> use or distribution of this e-mail is strictly prohibited.
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to