Exporting related tables from Access to one Excel worksheet -
i trying set access database , importing data excel. our analysis in r , current excel worksheet use formatted , arranged work exporting r , doing analysis there.
the format follows:
the first 12 columns of data describe date, location , other information applies following 12 columns. trouble single set of observations information in first 12 columns doesn't change row row values second 12 columns change row row.
year mm dd loc start end obs sess test object success 2013 5 15 park 1600 1700 mtm mtm1 1 ball y 2013 5 15 park 1600 1700 mtm mtm1 2 stick y 2013 5 15 park 1600 1700 mtm mtm1 3 rock n 2013 5 15 park 1600 1700 mtm mtm1 4 rock n 2013 5 15 park 1600 1700 mtm mtm1 5 stick y 2013 5 15 park 1600 1700 mtm mtm1 6 stick y 2013 6 24 yard 1500 1530 lfr lfr1 1 ball n 2013 6 24 yard 1500 1530 lfr lfr1 2 stick n 2013 6 24 yard 1500 1530 lfr lfr1 3 stick n 2013 6 24 yard 1500 1530 lfr lfr1 4 stick n 2013 6 24 yard 1500 1530 lfr lfr1 5 stick y 2013 6 24 yard 1500 1530 lfr lfr1 6 rock y 2013 6 24 yard 1500 1530 lfr lfr1 7 ball y
above imaginary dataset matches format of real 1 (the real 1 wide fit here).
notice entries year
, mm
(month), dd
(day), loc
(location), start
, end
, obs
(observer), , sess
(session) stay same test
, object
, , success
change row row given set of observations.
in access use unique_id (primary key) relate tables information first 8 columns need entered once , have relate each entry last 3 columns. in example then, have 1 excel worksheet become 2 related access tables (objects).
before converting access though know able export data excel (and/or directly text file) again. is, not want export multiple tables separate excel worksheets. want access tables within database exported 1 worksheet , in format shown above. reason run analysis in r based on both session , instance levels (called different things in real data, idea) important location data , result data associated every row in output file (.xls or .csv).
is possible?
i looking outline of how might done. specific code not necessary, though personal assessment of complexity of potential code (given complete , absolute ignorance of vba) required appreciated.
the answer appears yes. need create query return data original form , export query table.
Comments
Post a Comment