Hi All:
I'm using Access 2003 on Windows XP.
I'm creating a table where i'll be adding a new variable every week (based on the week number). This is a numeric variable. Once the variable is inserted, i need to run a GROUP BY query based on other character variables. For instance, i'm having a table as:
EMP_ID
Sales_week1
Sales_week2
Sales_week3,
my SQL query will be,
next week, when i add another variable Sales_week4. The query should update to:
I'm not sure how to automate this in Access.
Any help on this is appreciated.
Regards,
-Deepak
I'm using Access 2003 on Windows XP.
I'm creating a table where i'll be adding a new variable every week (based on the week number). This is a numeric variable. Once the variable is inserted, i need to run a GROUP BY query based on other character variables. For instance, i'm having a table as:
EMP_ID
Sales_week1
Sales_week2
Sales_week3,
my SQL query will be,
Code:
SELECT EMP_ID, SUM(sales_week1) as week1, SUM(sales_week2) as week2, SUM(sales_week3) as week3 FROM table1 group by EMP_ID;
Code:
SELECT EMP_ID, SUM(sales_week1) as week1, SUM(sales_week2) as week2, SUM(sales_week3) as week3, SUM(sales_week4) as week4 FROM table1 group by EMP_ID;
Any help on this is appreciated.
Regards,
-Deepak
Comment