Solved

what is going on with these results.

Posted on 2002-03-19
4
144 Views
Last Modified: 2013-12-24
<CFQUERY NAME="view_Q_CoName" DATASOURCE="show">
SELECT      BT_Booth1, visitorNumber, EX_Co_Name, EX_visitor_code
FROM         {oj EXH_CONTACT_INFO LEFT OUTER JOIN Booth_Information ON visitorNumber = BT_visitorNumber }
WHERE       (EX_Co_Name like '%#form.ex_co_name#%')
</CFQUERY>

using this query I am retrieving some records (duh)
now my issue is that my variable may return 2 records with the same name but different primary key ids


the results are displayed as such
current record        Coname      Code

the coname field is a "href" which is carring the visitor number in the url.

the issue is that when 2 records are found with the same number the url.visitornumber is now a number that is made up of the 2ids found and only one visitor is displayed. how would I get both records to be displaye and the proper visitor numbe to be carried over the url.correctly.

this is how I am using the href:

<a href="ex_show.cfm? &visitortornumber=<cfoutput>#Q_coname.visitornumber#</cfoutput>">#EX_CO_NAME#</a>
0
Comment
Question by:jriver12
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
winningl earned 50 total points
ID: 6880327

Try loop through the query:

<cfoutput query="view_Q_CoName">

<a href="ex_show.cfm? &visitortornumber=#visitornumber#">#EX_CO_NAME#</a> <BR><BR>

</cfoutput>

winningl
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6880351
try this:
<a href="ex_show.cfm?visitortornumber=<cfoutput>#ValueList(view_Q_CoName.visitornumber,",")
#</cfoutput>">#EX_CO_NAME#</a>

Now this will return a comma delimited list as the values.

IN your ex_show.cfm
change your query to be:

<CFQUERY NAME="ex_show" DATASOURCE="show">
Select * from yourtable
where id in (#URL.visitortornumber#)
</CFQUERY>

CJ
0
 

Author Comment

by:jriver12
ID: 6880490
found my issue I had the group attribute of the output query set to Coname, there for being that the records had the same name they where joined and seen as one.

I change that attribute to be visitor number and it now shows the records individualy.

problem solved.


thanks for the input
0
 

Author Comment

by:jriver12
ID: 6880498
Both solutions are good ones  so this is what I am going to do :

winningl:  come get these points.


cj: get the points posted to you on my next thread addressed to you.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

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…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now