Re: Acumulated Value
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Tue, 4 Sep 2007 07:21:26 -0400
What does "No results" mean? No records returned? An Error Message
returned?
Try breaking your query down into parts and see where it breaks down. You
might find it easier to build a base query and then use that query as the
source to get Acumulated.
SELECT Y1.Date, Y1.ID
, (SELECT sum ([Today])
FROM Index AS Y2
WHERE Y2.ID = Y1.ID
AND Y2.[Date] < Y1.[Date]) AS [Previous],
Y1.Today,
FROM Index AS Y1;
Save the above as qIndexBase. Now use that to get your final results
SELECT Q.Date, Q.ID, Q.[Previous],Q.Today,
IIf([Previous]*[Today]>0,[ Previous]*[Today],[Today]) AS Acumulated,
FROM qIndexBase AS Q
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"Marcelo Henderson via AccessMonster.com" <u27810@uwe> wrote in message
news:77b0bd29ce809@xxxxxx
No results, Spencer.
SELECT Y1.Date, Y1.ID, NZ((SELECT sum ([Today]) FROM Index AS
Y2
WHERE Y2.ID = Y1.ID AND Y2.[Date] < Y1.[Date]),0) AS
[Previous],
Y1.Today, IIf([Previous]*[Today]>0,[ Previous]*[Today],[Today]) AS
Acumulated,
Y1.Previous
FROM Index AS Y1;
But I get SUM. ""Select sum..." I wanna Multiplication,
Some idea?
Thanks
Regards
Henderson
--
Message posted via http://www.accessmonster.com
.
- Follow-Ups:
- Re: Acumulated Value
- From: Marcelo Henderson via AccessMonster.com
- Re: Acumulated Value
- References:
- Acumulated Value
- From: Marcelo Henderson via AccessMonster.com
- Re: Acumulated Value
- From: John Spencer
- Re: Acumulated Value
- From: Marcelo Henderson via AccessMonster.com
- Acumulated Value
- Prev by Date: Re: conversion number into text format
- Next by Date: Re: Compare records in a query then write equation??
- Previous by thread: Re: Acumulated Value
- Next by thread: Re: Acumulated Value
- Index(es):
Relevant Pages
|