At 03:51 AM 7/7/00 -0400, you wrote:
>Sorry about all the detail. I just thought it would make it easy to
>explain my problem.
Detail is our friend.
>I am doin g two queries in a loop 1 to get main items and one to get
>item details. I am trying to get them to match by the two fields
>ScenarioDetailID and ScenarioID. The queries do work to the extent that
>it does match ScenarioDetailID=#ScenarioDetailID# from the complete list
>but seem sto ignore what I would expect would keep the detail limited to
>the proper item.
>
>
>I guess I don't get the way the loops work. In my mind this should
>work. The long and short of my problem is that I cannot get my outout
>to list the way I want ( see Below at bottom). It is as if the
>conditions in the "Get Detail" query are being skipped.
>
>If anyone has in idea of the logic I'm missing or a better way to
>accomplish this I am more than open to suggestions.
>
>
>Kelly Olson
>
>
>
>
>
>
>THE DATA - Sample Only
>ScenarioDetail
>ScenarioDetailID ScenarioID CatagoryID
>76 54 0
>77 54 6
>78 55 1
>79 55 3
>80 55 7
>
>Detail
>DetailID DetailDescription CompanyID ScenarioDetailID ScenarioID
>21 0 12 49 50
>23 0 12 78 55
>24 0 12 78 55
>25 0 12 78 55
>26 0 12 78 55
>
>THE QUERY
>(#ScenarioID# is coming from the Previous page)
><CFQUERY NAME="ScenarioDetail" datasource="SCENARIO">
> SELECT a.CatagoryID, b.CatagoryDescription, a.ScenarioDetailID,
>b.CatagoryID FROM ScenarioDetail a, Catagory b WHERE
>ScenarioID=#ScenarioID# and a.catagoryID=b.catagoryID
></CFQUERY>
>
><CFQUERY NAME="GetDetail" datasource="SCENARIO">
> SELECT a.ScenarioDetailID, a.ScenarioID, b.ScenarioDetailID,
>b.ScenarioID, b.employeeskill, b.documentsUsed, b.EquipmentUsed,
>b.Interactions FROM ScenarioDetail a, Detail b WHERE
>a.ScenarioDetailID=b.ScenarioDetailID and a.scenarioID=#ScenarioID# and
>a.ScenarioID=b.ScenarioID
></CFQUERY>
>
>
>THE CFLOOP
><FORM METHOD="POST">
><CFLOOP QUERY="ScenarioDetail">
> <CFOUTPUT> #CatagoryDescription# #ScenarioID# #ScenarioDetailID#<br>
>
></CFOUTPUT>
>
><CFOUTPUT QUERY="GetDetail"> #ScenarioDetail.ScenarioDetailID#
>#ScenarioID# #EmployeeSkill# #DocumentsUsed# #EquipmentUsed#
>#Interactions#<br></CFOUTPUT>
></CFLOOP>
></FORM>
>
>
>THE OUTPUT
>(ScenarioID = 55
>ScenarioDetailID=78)
>Acceptance Inspection 55 78
> 78 55 Employye 1 doc 1
> 78 55 employee 2 equip 2
> 78 55 employee 3 mod 2 mod 3 inter 3
> 78 55 employee 4 doc 4 equip 4 inter 4
> Outgoing Inspection 55 79
> 78 55 Employye 1 doc 1
> 78 55 employee 2 equip 2
> 78 55 employee 3 mod 2 mod 3 inter 3
> 78 55 employee 4 doc 4 equip 4 inter 4
> Communication Skills 55 80
> 78 55 Employye 1 doc 1
> 78 55 employee 2 equip 2
> 78 55 employee 3 mod 2 mod 3 inter 3
> 78 55 employee 4 doc 4 equip 4 inter 4
>
>THE OUTPUT - DESIRED
>Acceptance Inspection 55 78
> 78 55 Employye 1 doc 1
> 78 55 employee 2 equip 2
> 78 55 employee 3 mod 2 mod 3 inter 3
> 78 55 employee 4 doc 4 equip 4 inter 4
> Outgoing Inspection 55 79
> Communication Skills 55 80
HTML email is not our friend.
OK. I know your problem. The problem is that you are looping through your
cfoutput. You may have noticed that the data for each block of
CategoryDescription output is the same. That's because for every record of
the loop the <cfoutput query="GetDetails"> is performed. If you know that
you will always want to output the details for only the first record, try this:
<cfif RowNum=1><cfoutput query="GetDetails"> [snip] </cfoutput></cfif>
In this one case, this will get your desired output. You need to make sure
that this will always be the case or you may need to rethink the output.
>--------------02EDDFCBC443DB118DB040CB
>Content-Type: text/html; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
>Sorry about all the detail. I just thought it would make it easy to
>explain my problem.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.