Solved

Query dbs

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Server with multiple sites and SSL 14 75
LAMP problem identifier tool ? 9 131
Use System DSN 6 95
spamming  on Hosted svrs? 6 109
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…
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…
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 …
Suggested Courses

739 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