A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Crosstab Query



 
 
Thread Tools Display Modes
  #1  
Old February 13th, 2007, 03:07 PM posted to microsoft.public.access.queries
MPM1100
external usenet poster
 
Posts: 23
Default Crosstab Query

I would like to enhance a crosstab query I am working with.

First, I have a tabe of transactions. Each transaction has a date, a trans
type, and an amount. In related table of trans types, a boolean descriptor is
defined to indicate if the trans amount needs to be negated for calculations.

My current crosstab query results look like this:
Year Fund SumOfAmount TranType1 TranType2 Etc...
2001 11 5,000.00 2,000.00 -7,000.00
2002 11 3,000.00 5,000.00 -2,000.00

So my question is this... For each year there is a final balance (e.g.
2000, 5000 .) That balance needs to be carried over to the next year for a
correct end of year balance. I would like to be able to this in a query, but
I don't know how to display and/or use the value. Is this possible?

This is the current SQL:
TRANSFORM Sum(IIf([TransCatNegate],[TransAmount]*-1,[TransAmount])) AS Amount
SELECT Transactions.TransBeginBudgetFY, Transactions.TransRFundtypeID,
Sum(IIf([TransCatNegate],[TransAmount]*-1,[TransAmount])) AS SumOfAmount
FROM (TransactionCategories INNER JOIN Transactions ON
TransactionCategories.TransCatID = Transactions.TransRTransCatID) INNER JOIN
TransCategoriesOfInterest ON TransactionCategories.TransCatID =
TransCategoriesOfInterest.UseTransCatID
WHERE (((Transactions.TransRFundtypeID)=11) AND
((Transactions.TransRRptCatID) Like "345"))
GROUP BY Transactions.TransBeginBudgetFY, Transactions.TransRFundtypeID
ORDER BY Transactions.TransBeginBudgetFY
PIVOT TransactionCategories.TransCategory;



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.