Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Query dbs

Posted on 2000-03-31
1
Medium Priority
?
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
dlewis9 earned 200 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

704 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