Thread: Help Please
View Single Post
  #9  
Old December 10th, 2009, 10:37 PM posted to microsoft.public.access
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Help Please

Another solution occurred to me, which may well be faster, if you are happy
to use the TOP option:

SELECT P1.UserName, P1.PostDate, P1.Amount,
P1.Amount -
(SELECT TOP 1 Amount
FROM tblPosted AS P2
WHERE P2.UserName = P1.UserName
AND P2.PostDate P1.PostDate
ORDER BY PostDate DESC)
AS Variance
FROM tblPosted AS P1
ORDER BY P1.UserName, P1.PostDate;

Ken Sheridan
Stafford, England

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200912/1