
Ken,
For me that still summed from January to December so what I did which is
probably ugly to you but works for me is:
Made another two calculated fields in the 1st query called FYDate (Financial
Year Date) and FYDateExt (Financial Year Date Extended) I did the same in
the 2nd query but called the fields FyearDate and FinYearDateExt, so for
FYDate and Fyeardate I got the year part & month part of the [Status Date]
and made them one number, in the FYDateExt and FinYearDateExt I checked for
the right two numbers of the FYDate & FyearDate and if they were either
01,02,03 I added a zero to the end of it so that all the numbers were
ascending.
The 2nd query asks the user for the financial year.
It all works with my data giving a running total starting in April of the
financial year as shown below in the datasheet view.
First query is:
SELECT tblResults.[Customer Name], tblResults.[Total Value], tblResults.[GM
%], tblResults.Salesperson, tblResults.Status, tblResults.[Status Date],
IIf(DatePart("m",[Status date])=1,1,IIf(DatePart("m",[Status
date])=2,2,IIf(DatePart("m",[Status date])=3,3,DatePart("m",[Status
date])))) AS SMonth, CCur([Total Value]) AS Tvalue, DatePart("yyyy",[Status
date]) & DatePart("m",[Status date]) AS FYDate,
IIf(Right([fydate],2)="01",[fydate] &
FROM tblResults
GROUP BY tblResults.[Customer Name], tblResults.[Total Value],
tblResults.[GM %], tblResults.Salesperson, tblResults.Status,
tblResults.[Status Date], CCur([Total Value]), DatePart("yyyy",[Status
date]) & DatePart("m",[Status date])
HAVING (((tblResults.Status)="Won"))
ORDER BY tblResults.[Status Date];
Second query is:
SELECT DatePart("yyyy",[Status Date]) AS SDate, Format([status date],"mmm")
AS FDate, CCur(DSum("[Total Value]","qryresultswon1","[FYDateExt]<=" &
[FinYearDateExt] & "")) AS RunTot, DatePart("yyyy",[Status date]) &
DatePart("m",[Status date]) AS FyearDate,
IIf(Right([fyeardate],2)="01",[fyeardate] &
FinYearDateExt
FROM qryResultsWon1
GROUP BY acctmonth([status date]), DatePart("yyyy",[Status Date]),
Format([status date],"mmm"), DatePart("yyyy",[Status date]) &
DatePart("m",[Status date]), DatePart("m",[Status Date]), acctyear([Status
Date],4,1)
HAVING (((acctyear([Status Date],4,1))=[Financial Year]))
ORDER BY DatePart("yyyy",[Status Date]);
SDate FDate RunTot FyearDate FinYearDateExt
2009 Apr $1,641,724.82 20094 20094
2009 May $1,879,387.20 20095 20095
2009 Jun $3,274,440.92 20096 20096
2009 Jul $3,674,921.53 20097 20097
2009 Aug $3,849,581.53 20098 20098
2009 Sep $4,257,363.88 20099 20099
2009 Oct $5,000,284.56 200910 200910
2009 Nov $5,312,691.33 200911 200911
2009 Dec $7,084,728.52 200912 200912
2010 Jan $7,764,984.20 20101 201010
2010 Feb $8,089,700.20 20102 201020
2010 Mar $8,113,323.20 20103 201030
Regards
Neil
and once again thank you for your help.