accessfever
Registered User.
- Local time
- Today, 11:47
- Joined
- Feb 7, 2010
- Messages
- 101
Hi,
I have 12 queries to update an Access table's one field based on 4 criteria. So basically, it is one month one query. Is it a way that I can change the 12 queries' codes to become just one module?
Below is the first and second query's SQL code:
1st query:
UPDATE [COST ACTUAL LOCAL CURR], COST_CURMTH_ SET [COST ACTUAL LOCAL CURR].TOTAL = 0, [COST ACTUAL LOCAL CURR].Oct = 0
WHERE (((COST_CURMTH_.CurMth_Day_Diff)<>0) AND (([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7276001" Or ([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7926031" Or ([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7926100") AND (([COST ACTUAL LOCAL CURR].CurMonth)="10"));
2nd query:
UPDATE [COST ACTUAL LOCAL CURR], COST_CURMTH_ SET [COST ACTUAL LOCAL CURR].TOTAL = [Oct], [COST ACTUAL LOCAL CURR].NOV = 0
WHERE (((COST_CURMTH_.CurMth_Day_Diff)<>0) AND (([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7276001" Or ([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7926031" Or ([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7926100") AND (([COST ACTUAL LOCAL CURR].CurMonth)="11"));
I have 12 queries to update an Access table's one field based on 4 criteria. So basically, it is one month one query. Is it a way that I can change the 12 queries' codes to become just one module?
Below is the first and second query's SQL code:
1st query:
UPDATE [COST ACTUAL LOCAL CURR], COST_CURMTH_ SET [COST ACTUAL LOCAL CURR].TOTAL = 0, [COST ACTUAL LOCAL CURR].Oct = 0
WHERE (((COST_CURMTH_.CurMth_Day_Diff)<>0) AND (([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7276001" Or ([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7926031" Or ([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7926100") AND (([COST ACTUAL LOCAL CURR].CurMonth)="10"));
2nd query:
UPDATE [COST ACTUAL LOCAL CURR], COST_CURMTH_ SET [COST ACTUAL LOCAL CURR].TOTAL = [Oct], [COST ACTUAL LOCAL CURR].NOV = 0
WHERE (((COST_CURMTH_.CurMth_Day_Diff)<>0) AND (([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7276001" Or ([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7926031" Or ([COST ACTUAL LOCAL CURR].ACCOUNT) Like "7926100") AND (([COST ACTUAL LOCAL CURR].CurMonth)="11"));