Re: Conditional Running Sum
- From: mezzanine1974 <savas_karaduman@xxxxxxxxx>
- Date: Sun, 30 Mar 2008 22:55:30 -0700 (PDT)
Hello Arch,
You are right that i did a mistake in the first line.
your statement CORRECT! <By "between" do you mean inclusive of the
Start date but not the
Finish date?>
Regardless how i define "between"-including or does not including
Start Date-, i can not get proper output.
May be i could not describe my problem well to you.
If you are interested, i am posting variations below with its output:
Variation1:
SELECT Query1.SortedDate, DSum("Money","Query1","[SortedDate] >= #" &
[Start] & "#" And "[SortedDate] < #" & [Finish] & "#") AS RunningMoney
FROM Query1
ORDER BY Query1.SortedDate;
***
Output for Variations1:
SortedDate RunningMoney
01/01/2008 13
02/01/2008 13
03/01/2008 13
04/01/2008 13
05/01/2008 13
Variation2: /Query maker approach
SELECT Query1.SortedDate, (SELECT Sum([Money])
FROM [Query1] AS [qry_1] WHERE [qry_1].[SortedDate]>=
[Query1].[Start] AND [qry_1].[SortedDate]<[Query1].[Finish]) AS
RunningMoney
FROM Query1
ORDER BY Query1.SortedDate;
***
Output for Variations2:
SortedDate RunningMoney
01/01/2008 10
02/01/2008 NULL
03/01/2008 12
04/01/2008 3
05/01/2008 NULL
.
- Follow-Ups:
- Re: Conditional Running Sum
- From: Arch
- Re: Conditional Running Sum
- References:
- Conditional Running Sum
- From: mezzanine1974
- Re: Conditional Running Sum
- From: Arch
- Conditional Running Sum
- Prev by Date: Re: Access 2007 RunTime SP-1... What about back-end DB?
- Next by Date: Advantages of Data Conversion, Data Formats and Data Entry Services by Data Entry India
- Previous by thread: Re: Conditional Running Sum
- Next by thread: Re: Conditional Running Sum
- Index(es):