Hello everyone, I am looking for a way to run a large number of Selects, iterating what fields are being selected, and what those fields are being renamed to.
I have a table like the one below:
For each row following the ID row, I need to run a select that selects, for example:
ID,
'First step' as 'Event',
10/01/2010 as 'Date'.
For the second row, the select would select 'Second Step' as 'Event', and 11/01/2010 as 'Date'.
This would iterate across all fields. Then the results would be unioned.
This to create a new table with the following fields: ID, event, and date.
With a limited number of rows the easiest way is simply to run separate selects for each row, and then union them.
However I now have a large number of rows so that would be very time consuming.
Is there a way to run the selects, iterating what fields are being selected, and what the fields are being renamed to?
I have been looking into batch macros, but they seem to only work when iterating over rows.
Solved! Go to Solution.
Hello @brizio97,
Would this be what you are looking for?
I got the table as I think you would want it? Could it be?
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regards