Iterating through columns in access/sql Solution? -


not sure if can done in vba skill learn if can entirely in sql statements.

say have 2 tables, first below, column until 12 (i didn't think designed well)

table 1

project id month1 dollars1 month2 dollars2 month3 dollars3

and second table 2

project id month dollars

is there way can iterate through columns each row in table 1, , create entry each month , dollar field?

i can see how can in excvel-vba, loop through columns , add new each instance of month , dollar or effect, access-vba bit more cryptic me, though sql quite intuitive me , if possible i'd love know!

best, kurt

try approach

insert table2 select projectid, month1, dollars1 table1 union select projectid, month2, dollars2 table1 union select projectid, month3, dollars3 table1 union select projectid, month4, dollars4 table1 union select projectid, month5, dollars5 table1 union select projectid, month6, dollars6 table1 union select projectid, month7, dollars7 table1 union select projectid, month8, dollars8 table1 union select projectid, month9, dollars9 table1 union select projectid, month10, dollars10 table1 union select projectid, month11, dollars11 table1 union select projectid, month12, dollars12 table1 union 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -