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 / General 1 / December 2007

Tip: Looking for answers? Try searching our database.

Last four records or each item

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J-P-W - 30 Dec 2007 00:39 GMT
Hi,

I have a database that lists each time stock items are purchased, who
they are purchased from and the date of that purchase.

I have a query that list those purchases, it's linked to the order
also to grab the purchase date.

The problem I have is that I've been asked to run a query that looks
up the last four purchase prices for each item, then get the highest
price of each to show as the base price for the database (I'll then
add their markup % to that).

I've successfully managed to list the last four in ascending order for
each individual item [using the Top Values facility in the query], but
I can only list all items or the tope four of ALL, not the tope four
of each, I need to get these last four of each before I consider
moving on to the top price of the last four!

Any ideas if this is possible? I've been around in circles so many
times I beginning to think perhaps I can only do it for individual
items, not the whole database!

Many thanks,

Jon
Bob Quintal - 30 Dec 2007 00:42 GMT
J-P-W <jonpwebb@gmail.com> wrote in
news:0abf18c9-5708-4df1-8442-
64120df3877a@s19g2000prg.googlegroups.co
m:

> Hi,
>
[quoted text clipped - 22 lines]
>
> Jon

What you have to do is get the top four items for each article as a
sub-form or sub-report of your list of individual articles.

Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Allen Browne - 30 Dec 2007 06:45 GMT
See:
   Subquery basics: TOP n records per group
at:
   http://allenbrowne.com/subquery-01.html#TopN

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hi,
>
[quoted text clipped - 22 lines]
>
> Jon
J-P-W - 30 Dec 2007 10:40 GMT
> See:
>     Subquery basics: TOP n records per group
[quoted text clipped - 34 lines]
>
> - Show quoted text -

Allen, 'Gawd Blimey' as us Londoners might say,

followed by a Gawd Bless You Guv'n'r

It does exaclty what I was hoping to do, thank you VERY much.

Jon
Allen Browne - 30 Dec 2007 12:18 GMT
Ah, she's right mate.

Gotta git t' London t'ear this fo' m'self!  :-)

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

Allen, 'Gawd Blimey' as us Londoners might say,

followed by a Gawd Bless You Guv'n'r

It does exaclty what I was hoping to do, thank you VERY much.

Jon

 
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.