G
Guest
Hello,
I have 2 Tables, CONTRACTS & CONTRACTS_OTHER_PARTIES, where they are linked
via ContractNumber. For every Contract there can me many
Contract_OtherParties.
I then Created a Cross Tab Query with
ContractNumber as the Row Heading
PartyNumber as the Column Heading
Part as the Value.
This is the SQL code:
TRANSFORM First(tblContracts_OtherParties.Party) AS FirstOfParty
SELECT tblContracts.ContractNumber
FROM tblContracts LEFT JOIN tblContracts_OtherParties ON
tblContracts.ContractNumber = tblContracts_OtherParties.ContractNumber
GROUP BY tblContracts.ContractNumber
PIVOT tblContracts_OtherParties.PartyNumber;
It produces the data as follows:
ContractNumber <> 1 2 3
--------------------------------------
AAA-01-2
ENG-01-1 zz xx bb
ENG-05-1 cc ff ee
ENG-05-2 aa gg aa
Note it is dummy data.
What I would like to do & cant figure out is how to Sort on the 1 column not
the Contract Number column.
Any help would be greatly appreciated.
Thank you,
Jeff
I have 2 Tables, CONTRACTS & CONTRACTS_OTHER_PARTIES, where they are linked
via ContractNumber. For every Contract there can me many
Contract_OtherParties.
I then Created a Cross Tab Query with
ContractNumber as the Row Heading
PartyNumber as the Column Heading
Part as the Value.
This is the SQL code:
TRANSFORM First(tblContracts_OtherParties.Party) AS FirstOfParty
SELECT tblContracts.ContractNumber
FROM tblContracts LEFT JOIN tblContracts_OtherParties ON
tblContracts.ContractNumber = tblContracts_OtherParties.ContractNumber
GROUP BY tblContracts.ContractNumber
PIVOT tblContracts_OtherParties.PartyNumber;
It produces the data as follows:
ContractNumber <> 1 2 3
--------------------------------------
AAA-01-2
ENG-01-1 zz xx bb
ENG-05-1 cc ff ee
ENG-05-2 aa gg aa
Note it is dummy data.
What I would like to do & cant figure out is how to Sort on the 1 column not
the Contract Number column.
Any help would be greatly appreciated.
Thank you,
Jeff