Look up the "BETWEEN" operator -- it is your friend

-----Original Message-----
From: Tim [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 10:50 AM
To: CF-Talk
Subject: WHERE statement with multiple ANDs


I am a little confused as to how to code a WHERE
statement that has more than one qualifier.  See this
code:

<CFQUERY NAME="qGetStatus" DATASOURCE="VISN">
SELECT      Location, Date_rcvd, status,
Certificate_Number
FROM         39_TRACKING
WHERE   Location  = '#form.location#'
        AND status = '#form.status#"
        AND date_rcvd>
#DateFormat(CreateODBCDate(Form.firstdate),
'm/d/yyyy')#
        AND date_rcvd <
#DateFormat(CreateODBCDate(Form.seconddate),
'm/d/yyyy')#
Group By        location, date_rcvd, status,
certificate_number
</CFQUERY>

The queary does not work.  Do I need to use
parentheses in a WHERE statement with a number of
AND's?  Is it even a good idea to use this many AND's
or is there another way I should be doing this?

Tim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to