--------------02EDDFCBC443DB118DB040CB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sorry about all the detail. I just thought it would make it easy to
explain my problem.
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
--------------02EDDFCBC443DB118DB040CB
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<b><tt>Sorry about all the detail. I just thought it would make it easy
to explain my problem.</tt></b><b><tt></tt></b>
<p><b><tt>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.</tt></b>
<br><b><tt></tt></b> <b><tt></tt></b>
<p><b><tt>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.</tt></b><b><tt></tt></b>
<p><b><tt>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.</tt></b>
<br><b><tt></tt></b> <b><tt></tt></b>
<p><b><tt>Kelly Olson</tt></b>
<br><b><tt></tt></b>
<br><b><tt></tt></b>
<br><b><tt></tt></b>
<br><b><tt></tt></b>
<br><b><tt></tt></b> <b><tt></tt></b>
<p><b><tt>THE DATA - Sample Only</tt></b>
<br><b><tt>ScenarioDetail</tt></b>
<br><tt>ScenarioDetailID ScenarioID CatagoryID</tt>
<br><tt>76
54 0</tt>
<br><tt>77
54 6</tt>
<br><tt>78
55 1</tt>
<br><tt>79
55 3</tt>
<br><tt>80
55 7</tt><tt></tt>
<p><b><tt>Detail</tt></b>
<br><tt>DetailID DetailDescription CompanyID ScenarioDetailID ScenarioID</tt>
<br><tt>21
0
12
49 50</tt>
<br><tt>23
0
12
78 55</tt>
<br><tt>24
0
12
78 55</tt>
<br><tt>25
0
12
78 55</tt>
<br><tt>26
0
12
78 55</tt>
<p><b><tt>THE QUERY</tt></b>
<br><b><tt>(#ScenarioID# is coming from the Previous page)</tt></b>
<br><tt><CFQUERY NAME="ScenarioDetail" datasource="SCENARIO"></tt>
<br><tt> SELECT a.CatagoryID, b.CatagoryDescription, a.ScenarioDetailID,
b.CatagoryID FROM ScenarioDetail a, Catagory b WHERE ScenarioID=#ScenarioID#
and a.catagoryID=b.catagoryID</tt>
<br><tt></CFQUERY></tt>
<p><tt><CFQUERY NAME="GetDetail" datasource="SCENARIO"></tt>
<br><tt> 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</tt>
<br><tt></CFQUERY></tt>
<br>
<p><b><tt>THE CFLOOP</tt></b>
<br><tt><FORM METHOD="POST"></tt>
<br><tt><CFLOOP QUERY="ScenarioDetail"></tt>
<br><tt> <CFOUTPUT> #CatagoryDescription# #ScenarioID#
#ScenarioDetailID#<br></tt>
<br><tt></CFOUTPUT></tt>
<p><tt><CFOUTPUT QUERY="GetDetail"> #ScenarioDetail.ScenarioDetailID#
#ScenarioID# #EmployeeSkill# #DocumentsUsed# #EquipmentUsed#
#Interactions#<br></CFOUTPUT></tt>
<br><tt></CFLOOP></tt>
<br><tt></FORM></tt>
<br>
<p><b><tt>THE OUTPUT</tt></b>
<br><b><tt>(ScenarioID = 55</tt></b>
<br><b><tt>ScenarioDetailID=78)</tt></b>
<br><tt>Acceptance Inspection 55 78</tt>
<br><tt> 78 55 Employye 1 doc
1</tt>
<br><tt> 78 55 employee 2 equip
2</tt>
<br><tt> 78 55 employee 3 mod
2 mod 3 inter 3</tt>
<br><tt> 78 55 employee 4 doc
4 equip 4 inter 4</tt>
<br><tt> Outgoing Inspection
55 79</tt>
<br><tt> 78 55 Employye 1 doc
1</tt>
<br><tt> 78 55 employee 2 equip
2</tt>
<br><tt> 78 55 employee 3 mod
2 mod 3 inter 3</tt>
<br><tt> 78 55 employee 4 doc
4 equip 4 inter 4</tt>
<br><tt> Communication Skills
55 80</tt>
<br><tt> 78 55 Employye 1 doc
1</tt>
<br><tt> 78 55 employee 2 equip
2</tt>
<br><tt> 78 55 employee 3 mod
2 mod 3 inter 3</tt>
<br><tt> 78 55 employee 4 doc
4 equip 4 inter 4</tt><tt></tt>
<p><b><tt>THE OUTPUT - DESIRED</tt></b>
<br><tt>Acceptance Inspection 55 78</tt>
<br><tt> 78 55 Employye 1 doc
1</tt>
<br><tt> 78 55 employee 2 equip
2</tt>
<br><tt> 78 55 employee 3 mod
2 mod 3 inter 3</tt>
<br><tt> 78 55 employee 4 doc
4 equip 4 inter 4</tt>
<br><tt> Outgoing Inspection
55 79</tt>
<br><tt> Communication Skills
55 80</tt>
<br><tt></tt> </html>
--------------02EDDFCBC443DB118DB040CB--
------------------------------------------------------------------------------
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.