Hi all
I am trying to create the following report. I have a parameter which asks a user, what date they want the report generated as at. Depending on the date they put in, I want to calculate the total value of depreciation transactions for that year to date. Our accounting year goes from November to October. So if a user enters the date 15/06/2010, I would like to return the total of all depreciation from 01/11/2009 to 15/06/2010. If they enter a date of 01/05/2006, I would like to return the total of depreciation from 01/11/2005 to 01/05/2006.
I have the following SQL code currently:
SELECT TRANSTYPE, SUM(AMOUNTMST) AS TotalDepn, TRANSDATE, ASSETIDFROM ASSETTRANSWHERE (TRANSTYPE = 3)GROUPBY TRANSTYPE, TRANSDATE, ASSETIDORDERBY ASSETID
So currently the report will return the total of all transactions where transaction type=3 (ie Depreciation). How do I adjust the report so that I return a second column of data, which is the year to date total of the year that the parameter @Date falls into?