Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merge Data from to lines into one line

Status
Not open for further replies.

aarellano

MIS
Oct 22, 2007
168
US
Hello,

I have a table that contains my budget and my actual costs, the budget cost is in one line and the actual cost is on another line.
I tried to create a query so I could see the budget cost and the actual cost in one line but I think I am going about it the wrong way. Here is what I have done so far

From the Costs Table I created a Query to get Only the Actual Cost and Made a table call Actual then I created a Query to get the Budget and made a table called Budget.

I tok Actual and budget tables and linked them by account number up to this point everything was going well until I come across the link type
there are times that I have data on the budget but no data on the Acutal and sometimes data on the Actual but not on the budget

How could I go about this one?

Thank you

 
Any chance you could post your table structure ?
I guess you only need a single aggregate query.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I think I got it. Here is what my table looks like

type
1=Acutal 2=Budget

type acct# Month10
1 1234 $100
2 1234 $110
1 1235 $500
2 1235 $495
1 1236 $0
2 1236 $350
1 1237 $150
2 1237 $0

So here is what I did
I created a query if type = 1 then Actual, if type = 2 then Budget.
Then I created another query that sums all the months upto month 10 if type = 1 then YTD Actual, If type = 2 then YTD Budget
Then I did a union all between query1 and query2
And then a crosstab with type for column heading and Month 10 for value
it is a bit cumbersome but it seems to work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top