coldFusion How can I change my popup IFrame to display dupe records?

I have a SQL statement that detects dupes, how can I use this statement to supply my IFrame link from my query results to display the dupe record?

SQL Statement:
SELECT * , (select count(*) 
FROM    materials dupe
where  dupe.Serial = t.Serial
and    dupe.ian = t.ian
		   
		) AS DupeCount
from   materials t	

Open in new window

     

Query results statement that I need to modify to display the dupe record:
(Searchpup.cfm should display the duplicate record (where serial & ian = another record))
<a href="Search.cfm?UIC=#UIC#&IAN=#IAN#&SERIAL=#SERIAL#" data-record-number="Searchpup.cfm?id=#keyID#" target="_blank" class="classToDisplayPopupHover"><font size=2><STRONG>#UIC#-#IAN#-#SERIAL#</strong></font></a>

Open in new window

DJPr0Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_agx_Commented:
Pass the following arguments the page that displays the dupe(s):
- Unique ID of the original record (ie the NON-DUPE record)
- Original record's #Serial#
- Original record's = #ian#

Then on the display page:

SELECT *
FROM    materials 
where  Serial = <cfqueryparam value="#url.originalSerial#" ...etc...>
and      ian = <cfqueryparam value="#url.originalIAN#" ....etc...>
and     TheRecordIDCOlumn <> <cfqueryparam value="#url.originalRecordID#" ...etc...>

Open in new window


That finds all dupes, where "dupe" means records with the same "Serial" and "IAN", but having a different record ID.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DJPr0Author Commented:
_agx_,

How do I modify the link to give the variables to the popup page? (Searchpup.cfm)
Link code:

<a href="Search.cfm?UIC=#UIC#&IAN=#IAN#&SERIAL=#SERIAL#" data-record-number="Searchpup.cfm?id=#keyID#" target="_blank" class="classToDisplayPopupHover"><font size=2><STRONG>#UIC#-#IAN#-#SERIAL#</strong></font></a>
_agx_Commented:
If #keyID# is the unique ID of the original record, just append the other two parameters:

            Searchpup.cfm?id=#keyID#&IAN=#IAN#&SERIAL=#SERIAL#

That'll pass the three values to the popup as:

               URL.ID, URL.IAN and URL.SERIAL

Just be sure to modify the names of the URL parameters in the cfquery to match.
DJPr0Author Commented:
Thanks _agx_!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.