Pelican Parts
Parts Catalog Accessories Catalog How To Articles Tech Forums
Call Pelican Parts at 888-280-7799
Shopping Cart Cart | Project List | Order Status | Help



Go Back   Pelican Parts Forums > Miscellaneous and Off Topic Forums > Off Topic Discussions


Reply
 
LinkBack Thread Tools Rate Thread
Author
Thread Post New Thread    Reply
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
Old 01-05-2007, 08:14 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #1 (permalink)
Formerly bb80sc
 
Vipergrün's Avatar
 
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
Old 01-05-2007, 09:59 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #2 (permalink)
Registered
 
id10t's Avatar
 
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.”
Old 01-05-2007, 10:36 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #3 (permalink)
Reply


 


All times are GMT -8. The time now is 08:42 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 -    DMCA Registered Agent Contact Page
 

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