Pelican Parts Forums

Pelican Parts Forums (http://forums.pelicanparts.com/)
-   Off Topic Discussions (http://forums.pelicanparts.com/off-topic-discussions/)
-   -   Access SUM query help... please (http://forums.pelicanparts.com/off-topic-discussions/323267-access-sum-query-help-please.html)

Neilk 01-05-2007 09:14 AM

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,

Vipergrün 01-05-2007 10:59 AM

Can u post an example of the query you are trying to run? May one that works and the one that does not?

id10t 01-05-2007 11:36 AM

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.


All times are GMT -8. The time now is 08:40 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0
Copyright 2025 Pelican Parts, LLC - Posts may be archived for display on the Pelican Parts Website


DTO Garage Plus vBulletin Plugins by Drive Thru Online, Inc.