Re: Acumulated Value



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



.



Relevant Pages

  • Re: OutputTo to Excel question
    ... I can't help you with the macro error message as I don't use macros. ... the result from a query. ... Save a query that pulls the same data as the report. ...
    (microsoft.public.access.macros)
  • Re: Selecting records using criteria as arguments for a mathematical operation
    ... Show us your query and the data types of the fields involved. ... error message seems to indicate you're doing something that violates ... In the Totals row of the query builder, have you considered changing the Sales column from GroupBy to Sum? ...
    (comp.databases.ms-access)
  • Re: Background Web Queries flaws!
    ... There is no way to trap errors on a background query. ... There is no way to control the timeout setting. ... The basic problem is that IE spits an error message before returning control ... > hard coded a 5 minute limit into the web query system. ...
    (microsoft.public.excel.programming)
  • Re: Update Query only works first time
    ... I don't know either -- but that is what you error message says -- perhaps you are not using an updateable recordset or records were locked by something else like a form or query ... Microsoft Access MVP 2006 ... It works the first time, but then there is a very long error message with several reasons why it does not work. ...
    (microsoft.public.access.queries)
  • Re: SQL Compact Edition does not recognize parameter
    ... you might try looking in the debugger to see what the parameters collection looks like before you execute the query. ... assured that all computers have the same installation. ... It's always the same error message althought there are 35 parameters ... Only the hardware is different but on one PDA the problem exists ...
    (microsoft.public.sqlserver.ce)