This post is related in several aspects to the following:
Selecting all columns that start with XXX using a wildcard?
I am currently using Access 2010. I would like to add new columns to my table, based off values of the other columns.
Current table (Table #1):
Row | PlaceID | FoodItem1_10 | FoodItem1_02 | FoodItem2_10 | FoodItem2_02
001 Park Y N Y N
002 Library Y N Y N
003 Museum Y N Y N
Where:
Item1_10....ItemN_10 is a field where a value of 'Y' (for Yes) is assigned if, at a particular location, they sell that food item only 10 months of the year. Otherwise, the value is 'N' for No.
Item1_02....ItemN_02 is a field where a value of 'Y' is assigned if, at a particular location, they sell that food item only 02 months of the year. Otherwise, the value is 'N' for No.
I want to add columns to Table #1, and have it look as follows:
Desired new table (Table #2):
Row | PlaceID | FoodItem1_10 | FoodItem1_02 | FoodItem2_10 | FoodItem2_02 | AnyItems_10months | AnyItems_02months
001 Park Y N Y N Y N
002 Library Y Y Y N Y Y
003 Museum Y N Y N Y N
Where:
AnyItems_10months is a field that captures whether or not a particular place sells any items for a 10 month period. This field takes the values 'Y' for when, in any column, the particular place has a value of 'Y' for columns Item1_10 ..... ItemN_10.
AnyItems_02months is a field that captures whether or not a particular place sells any items for a 02 month period. This field takes the values 'Y' for when, in any column, the particular place has a value of 'Y' for columns Item1_02 ..... ItemN_02.
What I have been trying:
Since my columns follow a particular naming pattern, I thought it would be best to use a wildcard to generate my two new columns as such:
Obstacle
-Access does not accept my expression.