Solved

Query dbs

Posted on 2000-03-31
1
147 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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
XML problem with Internet Explorer 7 29
excpetion with multiple catch 11 104
htaccess restrict subdomain 4 69
Nameserver and MX Record 2 43
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now