Selecting random weeks of the year

drisconsult

Drisconsult
Local time
Today, 16:38
Joined
Mar 31, 2004
Messages
125
Hello All

I have a number of Select queries that select 1st quarter up to 4th quarter of the year for accounting purposes. These are quite simple queries such as:

between "10" and "24" entered in the Criteria window. 10 and 24 being week numbers.

However if I wish to randomly select the week numbers after the query is loaded what is the correct code?

Regards
Terence
London
 
Code:
SELECT *
FROM Table1
WHERE (((Table1.Weeknr)=CInt(52*Rnd(Now()))));
Enjoy!
 
Help a thickie

Hello Guss2005

When the user loads the query, the "Enter Parameter Vaue" dialog box opens and the user will be expected to enter the required week numbers.

Where do I enter the code?
 
Not sure what you mean by "the code".

Please post your query without any asterisks (*).
You should have to enter any parameters.
 

Users who are viewing this thread

Back
Top Bottom