![]() |
|
|
|
Registered
Join Date: Feb 2000
Location: Dallas, TX
Posts: 4,612
|
Access SUM query help... please
Hi,
How's this for off-topic? I am trying to run a query in Access in which I want to get the latest balance on an account based on posting date ImportID Amount PostingDate Balance 2 -41066.62 10/17/06 -12.4 3 -105495.18 10/20/06 22.4 1 0 10/20/06 22.4 4 -22.4 10/31/06 0 So I setup a sum query and have no problem getting the Max Date however, I can't get the balance corresponding to that date to appear. When I select First Balance, it selects the first account Imported (importID), when I select Max it gives the me highest number balance (22.4) and when I select Min it will give me the lowest number (-12.4. Any tips on getting the balance for the latest posting date? Do I have to create two queries? One to pick the latest posting date and a second to tie that max posting date and importID to the balance? Any help would be appreciated. Thanks,
__________________
Neil '73 911S targa |
||
![]() |
|
Formerly bb80sc
Join Date: Aug 2001
Location: Hollywood Beach, CA
Posts: 4,361
|
Can u post an example of the query you are trying to run? May one that works and the one that does not?
__________________
Cheers -Brad 2015 Cayman GTS 2015 4Runner Limited |
||
![]() |
|
Registered
Join Date: Mar 2003
Posts: 10,336
|
sub queries.
select * from postingtable where importid like (select max(postingdate)) No copy of access handy and its been a while since I've done 'em, but this should get you going.
__________________
“IN MY EXPERIENCE, SUSAN, WITHIN THEIR HEADS TOO MANY HUMANS SPEND A LOT OF TIME IN THE MIDDLE OF WARS THAT HAPPENED CENTURIES AGO.” |
||
![]() |
|