Solved

Query dbs

Posted on 2000-03-31
1
151 Views
Last Modified: 2013-12-24
I have written a page that querys a dbs, then emails according to the results.  This is not working properly and I presume that the WHERE statement is wrong.

<cfquery Name="Return" Datasource="Advance">
SELECT      *
FROM      Library
WHERE (Status='onloan')
OR (Enddate = #daysdate#)
OR       (Enddate = #dayafterdate#)
OR      (Enddate = #tomorrowdate#)
</cfquery>

I need the query to retieve only records that have status onloan, and  where the end date is either of the 3 above.

Please can someone confirm that this is right, or advise me on the correct WHERE statement.

Thank you
0
Comment
Question by:Marandola
1 Comment
 
LVL 2

Accepted Solution

by:
dlewis9 earned 50 total points
ID: 2673708
You almost have it..

It would be more like this:

<cfquery Name="Return" Datasource="Advance">
SELECT *
FROM Library
WHERE Status='onloan' AND
((Enddate = #daysdate#) OR
 (Enddate = #dayafterdate#) OR
 (Enddate = #tomorrowdate#))
</cfquery>

0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question