Data Shaping Problem .. im stuck!
I cant figure out what im doing wrong... the tables are related, and the parent
and child sort fine, but the grandchild recordset repeats itself for each
iteration. Can anyone help me? Ive been stuck for a while :(
dbo.Section
-Section_No
dbo.Subsection
-Section_No
-SubSection_No
dbo.Heading
-Section_No
-Subsection_No
-Heading_No
QUERY
SQL = "SHAPE { SELECT * FROM dbo.Section ORDER BY Section_No } "
SQL = SQL + "APPEND(( Shape {SELECT * FROM dbo.Sub_Section ORDER BY
SubSection_No } AS rsSubSections"
SQL = SQL + " APPEND({SELECT * FROM Heading ORDER BY Heading_No} AS rsHeadings
"
SQL = SQL + " Relate subSection_No to subSection_No)) "
SQL = SQL + " RELATE Section_No to section_No )"
RESULTS
Section 1
Subsection 01 Raw Material and Packaging Specifications
Heading 1 Plant Requirements
Heading 1 Bags
Heading 1 Procedures
Heading 3 Plant Audits - AIB
Heading 4 Purchased Flour Specs - Go to DBC QA31
Section 2
Subsection 02 Operating Procedures
Heading 1 Plant Requirements
Heading 1 Bags
Heading 1 Procedures
Heading 3 Plant Audits - AIB
Heading 4 Purchased Flour Specs - Go to DBC QA31
|