SELECT TOP 3 ...

Signature
Regards
Jeff Boyce
www.InformationFutures.net
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Hi Jeff,
Thanks for your reply, but where would I insert this, if I put Select Top 3
at the beginning I only get the Top 3 (i.e. 3 results), as I have 5 business
units I want to get the Top 3 for each (by Spend, so 15 results in total...
Thanks for your help,
Louise
> SELECT TOP 3 ...
>
[quoted text clipped - 22 lines]
> > Can you help me please?
> > Many Thanks,
Jeff Boyce - 19 Apr 2008 18:51 GMT
Louise
Have you looked into using the Totals query?
Perhaps another of the newsgroup readers can offer a SQL statement to do
both at once.
If you open a query in design view, right-click in the open space above the
grid, select properties, and select the Top property, Access will modify the
SQL statement accordingly.

Signature
Regards
Jeff Boyce
www.InformationFutures.net
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
> Hi Jeff,
>
[quoted text clipped - 31 lines]
> > > Can you help me please?
> > > Many Thanks,
raskew - 19 Apr 2008 21:27 GMT
Hi -
Couldn't get that link to open properly.
Here's an example using Northwind's Categories and Products tables.
SELECT
Categories.CategoryName
, Products.ProductName
, Products.UnitsInStock
FROM
Categories
INNER JOIN
Products
ON
Categories.CategoryID = Products.CategoryID
WHERE
(((Products.UnitsInStock) In (
SELECT
Top 3 [UnitsInStock]
FROM
Products
WHERE
[CategoryID]=[Categories].[CategoryID]
ORDER BY
[UnitsInStock] Desc)))
ORDER BY
Categories.CategoryName
, Products.UnitsInStock DESC;
Bob
>Louise
>
[quoted text clipped - 12 lines]
>> > > Can you help me please?
>> > > Many Thanks,
raskew - 19 Apr 2008 19:02 GMT
Take a look at this MSKB article.
http://support.microsoft.com /q153/7/47.asp
HTH - Bob
>Hi Jeff,
>
[quoted text clipped - 10 lines]
>> > Can you help me please?
>> > Many Thanks,