• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

query problem

New Here ,
Oct 30, 2006 Oct 30, 2006

Copy link to clipboard

Copied

I have an access database set up to allow multiple people per ticket number. I have the attached code to pull the data. The problem is that it only pulls one person even though there are 6 listed in the database. Any idea why this is? When I do a COUNT(tblTripTransactions.EmpID) I get the number 6 returned so it does know there are 6. Could the problem be that I need a loop around the select statement to be able to pull all 6 employee id's? I guess what I really need to do is get the empid in a string like (12,23,34,45) from the query.
TOPICS
Advanced techniques

Views

473

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 30, 2006 Oct 30, 2006

Copy link to clipboard

Copied

Have you verified that ikt's only returning 1 row.

Try
<cfdump var="#details#">

If that only has 1 row the query is the problem, if it has 6 then you'd probably better post the code to output it...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2006 Oct 30, 2006

Copy link to clipboard

Copied

That pulls back all 6 rows. I have attached my page code below.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 30, 2006 Oct 30, 2006

Copy link to clipboard

Copied

I didn't see <cfoutput query="driver"> anywhere. Mind you I only looked at the visible code.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 30, 2006 Oct 30, 2006

Copy link to clipboard

Copied

You need something more like

<cfquery name="details">
details query here
</cfquery>
<Cfloop query="details">
<!---Output details data--->
<cfif details.Employee neq "">
<Cfquery name="driver">
driver query here
</cfquery>
<!---Output driver data--->
</cfif>
</cfloop>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 30, 2006 Oct 30, 2006

Copy link to clipboard

Copied

Could you put that into the current code I have because I am unable to see what you mean. I have the following but that doesn't change anything.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 30, 2006 Oct 30, 2006

Copy link to clipboard

Copied

LATEST
wrong code for outputting the resultset of query "details": your code will always output only first row because you have not defined <cfoutput query="details">. change your page's code to the attached and all should work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation