Hi,
(sorry for my English, I'm french)
I have a Table divided into several groups (A, B, C, etc.).
In each group, I need to extract some random records
and put them in one form.
For my tests, I make these 3 queries (separately, they working good for me):
==================
SELECT TOP 5 Rnd([ID]) AS Expr1, Table1.ID, Table1.Group
FROM Table1
WHERE (((Table1.Group)="A"))
ORDER BY Rnd([ID]);
SELECT TOP 2 Rnd([ID]) AS Expr1, Table1.ID, Table1.Group
FROM Table1
WHERE (((Table1.Group)="B"))
ORDER BY Rnd([ID]);
SELECT TOP 3 Rnd([ID]) AS Expr1, Table1.ID, Table1.Group
FROM Table1
WHERE (((Table1.Group)="C"))
ORDER BY Rnd([ID]);
==================
But when I try to create a UNION Query, the "Order by" applies only on the first item. I understant it's the normal beviator. I need the random in each group...
Do you know how can I create a form containing the result of these queries?
Thanks!
Alain
(sorry for my English, I'm french)
I have a Table divided into several groups (A, B, C, etc.).
In each group, I need to extract some random records
and put them in one form.
For my tests, I make these 3 queries (separately, they working good for me):
==================
SELECT TOP 5 Rnd([ID]) AS Expr1, Table1.ID, Table1.Group
FROM Table1
WHERE (((Table1.Group)="A"))
ORDER BY Rnd([ID]);
SELECT TOP 2 Rnd([ID]) AS Expr1, Table1.ID, Table1.Group
FROM Table1
WHERE (((Table1.Group)="B"))
ORDER BY Rnd([ID]);
SELECT TOP 3 Rnd([ID]) AS Expr1, Table1.ID, Table1.Group
FROM Table1
WHERE (((Table1.Group)="C"))
ORDER BY Rnd([ID]);
==================
But when I try to create a UNION Query, the "Order by" applies only on the first item. I understant it's the normal beviator. I need the random in each group...
Do you know how can I create a form containing the result of these queries?
Thanks!
Alain