Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ColdFusion Database Record Comparison -- How?

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
Suggested Courses

926 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