From: moso97ad on
Hello,

I have imported two spreadsheets from excel to two temporary tables
called "import_tbl_contract" and "import_tbl_products". I do this on
daily basis and import many spreadsheets.

I end up with these data:

[import_tbl_contract]
contract_number
contract_title
start_date
end_date

[import_tbl_products]
product_number
product_text
price

I now append these data to the following two tables:

[tbl_contract]
contract_id (PK)
contract_title
start_date
end_date

e.g.
1; Syringes and needles; 01-01-2010; 31-12-2010

[tbl_products]
product_id
product_number
product_text
price

e.g.
1; 02030405; syringe 1; dkk 12,00
2; 05063004; syringe 2; dkk 10,00
3; 74737327; syringe 3; dkk 15,00

I now want to join the data in a junction table:

[tbl_contractdetails]
contract_detail_id
contract_id
product_id

e.g.:
1; 1; 1
1; 1; 2
1; 1; 3

How can I do this, when I on daily basis import many spreadsheets? I'm
a newbie to SQL and VBA.

Thanks in advance.

Morten
From: moso97ad on
On 8 Apr., 17:52, John W. Vinson <jvinson(a)STOP_SPAM.WysardOfInfo.com>
wrote:
..
>
> Do any of your spreadsheets provide a logical link between products and
> contracts?
> --
>
>              John W. Vinson [MVP]

I have the contract_number which links the contract and products.

Morten
 | 
Pages: 1
Prev: Pivot fields
Next: must select from combobox first