Solved

ColdFusion Database Record Comparison -- How?

Posted on 2014-02-06
2
202 Views
Last Modified: 2014-04-08
Hello Experts:
I am in a jam today as I have been hitting my head against the wall for a couple of days now.

Simply:
I have an access database with two fields -- SCRUB NSCRUB

I need to take the values one at a time that are in NSCRUB and see if they exist in SCRUB, if they do, then just show to screen "Record Exist: "data in the record"

It is really that simple. I have written a cfquery and cfloop and the best I can get is for the code to run until it finds the record from NSCRUB in SCRUB, and that is it, it will never go onto the next record in NSCRUB and try to find it. It just stops at the first record and doesn't try to find any records past the first.

I can past code, but really it is all of 8 lines and not sure it would even help???

Thank you so much!!
0
Comment
Question by:sscottinandrews
[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
  • 2
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 39840104
Assuming both columns contain simple values, it could be as simple as a self join:

SELECT s.Scrub TheValueThatExistsInScrub
FROM   YourTable n INNER JOIN YourTable s ON s.Scrub = n.NScrub

Sample Data
Row | NSCRUB | SCRUB
1 | 9   | 1  
2 | 6   | 4  
3 | 18  | 6  
4 | 17  | 19  
5 | 53  | 42  
6 | 42  | 85  

Result:
Row | THEVALUETHATEXISTSINSCRUB
1 | 6  
2 | 42
0
 
LVL 52

Expert Comment

by:_agx_
ID: 39840252
BTW, this seems like more of a SQL question. However, for ColdFusion specific stuff, you will get more attention from the CF experts if you include one of the CF zones in your question topics, such as

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Cold_Fusion_Markup_Language/
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

623 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