SpaceMonkey4969
Programmer
Hello
Ok here's my question, I sure hope you guys can help me.
I'm writting a query to Select the data from 1 table (TblData) and Insert it into 2 separate tables (tblSep1 & tblSep2).
The 1st table that I'm going to insert into contains the Main types of Units, The second table will contain all the different Quantity's and Prices for that Unit.
EXAMPLE:
TblData -- Desc Size Qty Price SKU UPC
Oil 6 pack 30ml 9.99 1122 2222
Oil 12 Pack 60ml 14.99 2211 3333
Oil 24 Pack 90 ml 20.99 3322 4444
fuel 6 pack 60ml 10.00 4445 5555
I would insert into tblSep1 (which is the Main Type of unit) the Desc, Qty(min)
Desc Qty
OIL 30ml
fuel 60ml
This table would have an ID for this type of Item lets say the id will be 1234 for OIl and 5678 for fuel
And Insert into tblSep2
ID size qty price
1234 6 pack 30ml 9.99
1234 12 pack 60ml 14.99
1234 24 pack 90ml 20.99
5678 6 pack 60ml 10.00
I need this query to do this all without any user input, Just press RUN and have it do the correct amout of inserts for each table.
If there is only one qty for a certain ITEM, then only do one insert(like the fuel item), but if there is more then 1 quantity (OIL) then do more then insert into tblSep2.
HUGE! thank you in advance
Ok here's my question, I sure hope you guys can help me.
I'm writting a query to Select the data from 1 table (TblData) and Insert it into 2 separate tables (tblSep1 & tblSep2).
The 1st table that I'm going to insert into contains the Main types of Units, The second table will contain all the different Quantity's and Prices for that Unit.
EXAMPLE:
TblData -- Desc Size Qty Price SKU UPC
Oil 6 pack 30ml 9.99 1122 2222
Oil 12 Pack 60ml 14.99 2211 3333
Oil 24 Pack 90 ml 20.99 3322 4444
fuel 6 pack 60ml 10.00 4445 5555
I would insert into tblSep1 (which is the Main Type of unit) the Desc, Qty(min)
Desc Qty
OIL 30ml
fuel 60ml
This table would have an ID for this type of Item lets say the id will be 1234 for OIl and 5678 for fuel
And Insert into tblSep2
ID size qty price
1234 6 pack 30ml 9.99
1234 12 pack 60ml 14.99
1234 24 pack 90ml 20.99
5678 6 pack 60ml 10.00
I need this query to do this all without any user input, Just press RUN and have it do the correct amout of inserts for each table.
If there is only one qty for a certain ITEM, then only do one insert(like the fuel item), but if there is more then 1 quantity (OIL) then do more then insert into tblSep2.
HUGE! thank you in advance