PC Review


Reply
Thread Tools Rate Thread

Aggregate rank query question

 
 
Mikael Lindqvist
Guest
Posts: n/a
 
      11th Jan 2008
Hi everyone,

I found an older thread that partly answered my question:

http://www.microsoft.com/office/comm...=en-us&m=1&p=1

Which describes how to create a query that ranks different fields.

Now, I have a table with various records for same field and I need to sum
the records (Profits) and then return the (companys) with biggest aggregate
Profit.

I believe I need to change this query:

(SELECT Count(*) FROM tblCompanyProfits AS VT
WHERE VT.Region = tblCompanyProfits.Region AND
VT.Profits > tblCompanyProfits.Profits)+1

To an aggregate query, but what should it look like?

If I get above right I guess the rank-part does work as given?

GroupRank: (SELECT Count(*) FROM tblCompanyProfits AS VT WHERE
VT.Region = tblCompanyProfits.Region AND VT.Profits >
tblCompanyProfits.Profits)+1

Good weekend to everyone!

Cheers,
Mikael


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aggregate Query Question Marcin Peciak Microsoft Access Queries 1 7th Jul 2009 12:29 AM
aggregate query JRough Microsoft Access 2 2nd May 2008 10:17 PM
Aggregate rank query question Mikael Lindqvist Microsoft Access Queries 8 15th Jan 2008 06:50 AM
Aggregate Function in a query based on a query JK Microsoft Access Queries 0 17th Aug 2006 07:19 PM
aggregate query question =?Utf-8?B?ZGVvODk=?= Microsoft Access Queries 2 14th Jun 2005 01:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:55 AM.