Selecting a *percentage* of records between given dates:

jread

Registered User.
Local time
Yesterday, 19:56
Joined
Dec 10, 2007
Messages
12
Hello,

I am using Access 2003 and am trying to write a query to create a temporary table of records based on dates entered by the user. The records should be random and the selection should only return 30% of them. I think I have the basic logic outlined below, but I cannot figure out the syntax for this query. If anyone could help me, I would appreciate it very much!

SELECT top 30 PERCENT table.date_final, table.ID, table.project, table.status
INTO tblTemp
FROM table
WHERE table.date_final Between (dateEntered AND Date() )
ORDER BY table.RandomNumber
 
try this instead:


SELECT top 30 PERCENT table.date_final, table.ID, table.project, table.status
INTO tblTemp
FROM table
WHERE table.date_final Between (dateEntered AND Date() )
ORDER BY rnd(a Numeric DataType Field In Your Table)
 
Thank you :)
 

Users who are viewing this thread

Back
Top Bottom