Hi,
I have been working on this since last October (on and off), without success
. I have two tables as follows:
Shipments .................Invoices
SId (PK)......................IId
LoadNumber ................S_SId
CargoId ......................InvoiceType (10 Types)
ContractId ..................InvoiceSubType (4 Sub Types)
Etc ............................DateReceived
.................................Amount
.................................PaymentRef
................................ Etc
They are linked 1 to Many on SID ------ S SId
I need to develop a query that will provide me with a table that looks like this (for up to 40 types/subtypes of Invoice);
SId ............Type1_Sub1 ..........Type1_Sub2 .........Type2_Sub1 ......Type2_Sub2
1 .................IId 7 ........................-- ....................... ...IId 5 ...................-.-
2 .................IId 8 .........................IId 1 ................... - ..........................IId 3
The results in this table will be compared to a complex select query called “InvoicesExpected” which draws data from 7 other queries/tables to establish when and indeed if each Type/SubType of Invoice is Due, The results from the “InvoiceExpected” query look like this;
SId ........Type1_Sub1 ........Type1_Sub2 .............Type2_Sub1 ..........Type2_Sub2
1 ............01/01/10 ..............05/01/10 ....................05/08/09 .................N/A
2 ............N/A......................09/05/10 ....................N/A .........................06/07/09
The aim is to produce a form called “Compliance” which tells the user which invoices are due when and most importantly which have not yet arrived (and as such have no record in the “Invoices” table).
SId # 1 ..........Due ..........Date Received ..........Amount ...........PaymentRef
Type1_Sub1...01/01/10.....01/01/10 ....................$ 1,000,000 ........... 089
Type1_Sub2...05/01/10 .....MISSING ........................ - ...................... -
Type2_Sub1...05/08/09......04/08/09...................$ 3,456....................056
Type2_Sub2...N/A.............N/A............................N/A.........................N/A
I have achieved this using Union Queries, but when I split the database to run in a multiuser environment the number of links exceeded the number Jet could handle.
Another issue is that ideally the product should be editable by the user, without having to bring up pop ups to change/add data etc. This was required when I used the union query solution.
Can anyone suggest a way I can link the tables or indeed restructure them which would allow me to produce the desired output? I do not want to add 40 tables reflecting each Type/SubType linked to the Shipments Table because this will make things too complex.
Any assistance would be much appreciated.
I have been working on this since last October (on and off), without success

Shipments .................Invoices
SId (PK)......................IId
LoadNumber ................S_SId
CargoId ......................InvoiceType (10 Types)
ContractId ..................InvoiceSubType (4 Sub Types)
Etc ............................DateReceived
.................................Amount
.................................PaymentRef
................................ Etc
They are linked 1 to Many on SID ------ S SId
I need to develop a query that will provide me with a table that looks like this (for up to 40 types/subtypes of Invoice);
SId ............Type1_Sub1 ..........Type1_Sub2 .........Type2_Sub1 ......Type2_Sub2
1 .................IId 7 ........................-- ....................... ...IId 5 ...................-.-
2 .................IId 8 .........................IId 1 ................... - ..........................IId 3
The results in this table will be compared to a complex select query called “InvoicesExpected” which draws data from 7 other queries/tables to establish when and indeed if each Type/SubType of Invoice is Due, The results from the “InvoiceExpected” query look like this;
SId ........Type1_Sub1 ........Type1_Sub2 .............Type2_Sub1 ..........Type2_Sub2
1 ............01/01/10 ..............05/01/10 ....................05/08/09 .................N/A
2 ............N/A......................09/05/10 ....................N/A .........................06/07/09
The aim is to produce a form called “Compliance” which tells the user which invoices are due when and most importantly which have not yet arrived (and as such have no record in the “Invoices” table).
SId # 1 ..........Due ..........Date Received ..........Amount ...........PaymentRef
Type1_Sub1...01/01/10.....01/01/10 ....................$ 1,000,000 ........... 089
Type1_Sub2...05/01/10 .....MISSING ........................ - ...................... -
Type2_Sub1...05/08/09......04/08/09...................$ 3,456....................056
Type2_Sub2...N/A.............N/A............................N/A.........................N/A
I have achieved this using Union Queries, but when I split the database to run in a multiuser environment the number of links exceeded the number Jet could handle.

Another issue is that ideally the product should be editable by the user, without having to bring up pop ups to change/add data etc. This was required when I used the union query solution.
Can anyone suggest a way I can link the tables or indeed restructure them which would allow me to produce the desired output? I do not want to add 40 tables reflecting each Type/SubType linked to the Shipments Table because this will make things too complex.
Any assistance would be much appreciated.
Last edited: