georgesOne
Technical User
Hi All:
How do I get the top 10 records from the following QUERY1 with a single query:
SELECT tbl_Form1.RName, Count(tbl_Form1.RName) AS [Number], 1 AS [Position]
FROM tbl_Form1
GROUP BY tbl_Form1.RtName
HAVING (Count(tbl_Form1.RName))>1
ORDER BY Count(tbl_Form1.RName) DESC
I tried to modify QUERY1 to
SELECT TOP 10 tbl_Form1.RName, Count(tbl_Form1.RName) AS [Number], 1 AS [Position]
FROM tbl_Form1
GROUP BY tbl_Form1.RtName
HAVING (Count(tbl_Form1.RName))>1
ORDER BY Count(tbl_Form1.RName) DESC
but I get the same result as with QUERY1.
If I use the following QUERY2
SELECT TOP 10 Query1.RName, Query1.Number, 1 AS [Position] FROM Query1;
I get the desired result.
Any comments?
Thanks, georges
How do I get the top 10 records from the following QUERY1 with a single query:
SELECT tbl_Form1.RName, Count(tbl_Form1.RName) AS [Number], 1 AS [Position]
FROM tbl_Form1
GROUP BY tbl_Form1.RtName
HAVING (Count(tbl_Form1.RName))>1
ORDER BY Count(tbl_Form1.RName) DESC
I tried to modify QUERY1 to
SELECT TOP 10 tbl_Form1.RName, Count(tbl_Form1.RName) AS [Number], 1 AS [Position]
FROM tbl_Form1
GROUP BY tbl_Form1.RtName
HAVING (Count(tbl_Form1.RName))>1
ORDER BY Count(tbl_Form1.RName) DESC
but I get the same result as with QUERY1.
If I use the following QUERY2
SELECT TOP 10 Query1.RName, Query1.Number, 1 AS [Position] FROM Query1;
I get the desired result.
Any comments?
Thanks, georges