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

x
?
Solved

ColdFusion Database Record Comparison -- How?

Posted on 2014-02-06
2
Medium Priority
?
213 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 2000 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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

715 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