Year to date expression/calculation

  • Thread starter TonyWilliams via AccessMonster.com
  • Start date
T

TonyWilliams via AccessMonster.com

I have a report based on a query that has a number of calculated controls.
The query also includes a month as txtmonth which is used in the report. data
is collected half yearly in June and December. I am trying to produce a
report that looks like this:

June 2009 Year to date
Field 1 Total 2000 2000
Field 2 Total 1000 1000
Field 3 Total 3000 3000

December 2009 Year to date
Field 1 Total 1000 3000
Field 2 Total 2000 3000
Field 3 Total 4000 7000

Can someone help with the formula for the controls that calculate the year to
date totals?
I've Googled a question on calculating YTD but can't find anything that does
what I want to do.
Thanks
Tony
 
D

Dale Fye

By "Year to date" do you mean calendar year, or do you mean the years
starting (June 2009 and December 2009)?

What is the SQL of the query you currently have for this reports Record
Source?
 
T

TonyWilliams via AccessMonster.com

Hi Dale YTD is a calendar year Jan-Dec.
here is my sql:
SELECT [qryasset%2].txtmonth, ([Debt%]/[SumOftxttotalline])*100 AS [Debt%2],
([PM%]/[SumOftxttotalline])*100 AS [PM%2], ([Stock%]/[SumOftxttotalline])*100
AS [Stock%2], ([Prop%]/[SumOftxttotalline])*100 AS [Prop%2], ([Cashflow%]/
[SumOftxttotalline])*100 AS [cashflow%2], ([Other%]/[SumOftxttotalline])*100
AS [other%2], [qryasset%2].[Debt%], [qryasset%2].[PM%], [qryasset%2].[Stock%],
[qryasset%2].[Prop%], [qryasset%2].[Cashflow%], [qryasset%2].[Other%],
[qryasset%2].SumOftxttotalline
FROM [qryasset%2]
GROUP BY [qryasset%2].txtmonth, [qryasset%2].[Debt%], [qryasset%2].[PM%],
[qryasset%2].[Stock%], [qryasset%2].[Prop%], [qryasset%2].[Cashflow%],
[qryasset%2].[Other%], [qryasset%2].SumOftxttotalline;

Any help?
Thanks
Tony
Dale said:
By "Year to date" do you mean calendar year, or do you mean the years
starting (June 2009 and December 2009)?

What is the SQL of the query you currently have for this reports Record
Source?

----
HTH
Dale
I have a report based on a query that has a number of calculated controls.
The query also includes a month as txtmonth which is used in the report. data
[quoted text clipped - 17 lines]
Thanks
Tony
 

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