Solved

Query dbs

Posted on 2000-03-31
1
150 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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