Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / March 2006

Tip: Looking for answers? Try searching our database.

FUNCTION

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
angie - 29 Mar 2006 12:49 GMT
i have a query that consists of various fields among which i want to
manipulate the following:

i have a unique field (ID) for which i have multiple entries on the
following fields:
DATE & AMOUNT. i want the query to return the amount corresponding to the
latest date for each id.
i have created a totals query and i have selected the maxDATE which is
working properly for the DATE field. then i have selected the max or last
AMOUNT but it returns the maximum amount, not the amount corresponding to the
maximum date i seek for.

could you help me?
John Spencer - 29 Mar 2006 13:42 GMT
You can do this in two queries.
Save your first query minus the Maximum amount field
Create a new query with your table and the saved query.  Join the ID to the
ID and the Date to the Max Date.  Add the Amount in from the table.

You can also do this in one query.  That would look something like the
following in the SQL view of a query.

SELECT [ID], [Date], [Amount]
FROM [YourTableName]
WHERE [Date] =
  (SELECT Max(T.[Date])
   FROM [YourTableName] as T
   WHERE T.ID = [YourTableName].ID)

>i have a query that consists of various fields among which i want to
> manipulate the following:
[quoted text clipped - 10 lines]
>
> could you help me?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.