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 ToolkitsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / September 2006

Tip: Looking for answers? Try searching our database.

Group by Query----to also include respective record details

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MFR - 14 Sep 2006 13:06 GMT
In my query I would like to see the Security Number (I used Group by
this)----Last Trade Time (I used "max" for this one) -----but I also want it
to include the respecitve information for the last trade----Volume and Price.
I've managed to isolate the the Security Number so each is unique, and
identified the Last trade of the day, but how can I get it to also show the
other two fields----for that trade?

MFR
Gary Walter - 14 Sep 2006 14:41 GMT
> In my query I would like to see the Security Number (I used Group by
> this)----Last Trade Time (I used "max" for this one) -----but I also want
[quoted text clipped - 5 lines]
> the
> other two fields----for that trade?

one way:
(replace "yurtable" w/ name of your table)

SELECT
[Security Number],
[Last Trade Time],
Volume,
Price
FROM
yurtable
WHERE
[Last Trade Time] =
(SELECT
 Max(t.[Last Trade Time])
 FROM
 yurtable As t
 WHERE
  t.[Security Number] = yurtable.[Security Number]);

the advantage of putting the aggregation
in the WHERE clause should get you an
updateable query....
 
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



©2010 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.