Query -Change Column Headings each time

E

Eastar

I am a new user of Access. I am not sure this is a right question.
Assume I have two tabels

Jan Feb Mar Apr May Jun
Table 1 Budget 98 98 56 45 879 99


Jan Feb Mar Apr May Jun
Table2 Actual 89 89 95 54 879 89

I want to set up a query. in the query, I will use budget number only if
actual is not available, once the actual number is available, I will replace
with actuals.
For example, if January actual is available, I will replace budget(98) with
actual (89).

Query Jan Feb Mar Apr May Jun Total

Actual Actual Budget Budget Budget Budget
(If avaible) (If avaible)
My problem is I have to change the total operations every time when I change
the column heading of the query.

thanks for your help.
 
J

James A. Fortune

Eastar said:
I am a new user of Access. I am not sure this is a right question.
Assume I have two tabels

Jan Feb Mar Apr May Jun
Table 1 Budget 98 98 56 45 879 99


Jan Feb Mar Apr May Jun
Table2 Actual 89 89 95 54 879 89

I want to set up a query. in the query, I will use budget number only if
actual is not available, once the actual number is available, I will replace
with actuals.
For example, if January actual is available, I will replace budget(98) with
actual (89).

Query Jan Feb Mar Apr May Jun Total

Actual Actual Budget Budget Budget Budget
(If avaible) (If avaible)
My problem is I have to change the total operations every time when I change
the column heading of the query.

thanks for your help.

Maybe:

tblBudgetActual
BAID AutoNumber
Period Date/Time Format: mmm yy
Budget Integer
Actual Integer

BAID Period Budget Actual
1 Jan 08 98 89
2 Feb 08 98 89
3 Mar 08 56 95
4 Apr 08 45 54
5 May 08 879 879
6 Jun 08 99 89

SQL View:
SELECT Period, IIf(Actual IS NULL, Budget, Actual) As BestGuess FROM
tblBudgetActual ORDER BY Period;

James A. Fortune
(e-mail address removed)
 
E

Eastar

James,
Thank you so much. I do not understand the code you wrote down yet. Bit I
think that will solve the problem.

thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top