HenryAnthony
Technical User
Hi,
I am trying to follow steps found in other threads to randomly order a query of 2009 records. I get an error: Compile error in query expression 'rnd([MyTable].NumField)' Here is my SQL:
SELECT TOP 2009 [MyTable].NumField
FROM MyTable
ORDER BY rnd([MyTable].NumField);
I got my example from faq701-2534. The faq text follows: This FAQ outlines a way of retrieving a random set of records for audit or other prurposes. The method requires that the table has a numerical field on which to operate. The sql is very simple
select top X from yourtable
order by rnd(numericalfield)
This will give the x records and will be different everytime it is run.
Regards,
Henry
I am trying to follow steps found in other threads to randomly order a query of 2009 records. I get an error: Compile error in query expression 'rnd([MyTable].NumField)' Here is my SQL:
SELECT TOP 2009 [MyTable].NumField
FROM MyTable
ORDER BY rnd([MyTable].NumField);
I got my example from faq701-2534. The faq text follows: This FAQ outlines a way of retrieving a random set of records for audit or other prurposes. The method requires that the table has a numerical field on which to operate. The sql is very simple
select top X from yourtable
order by rnd(numericalfield)
This will give the x records and will be different everytime it is run.
Regards,
Henry