Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random Selection

Status
Not open for further replies.

MKH2001

Technical User
Jan 7, 2003
90
GB
I have a problem (so my pshychiatrist tells me) that I have been looking at recently which is, of course, causing me some problems.

What I am looking to do is a report based on a data selection and report a 10% (or other percentage) of the result.

I am trying to use the random statement:

Code:
SELECT TOP 5000 Rnd([IMSV7_INLAI].[INSPNO]) AS Expr1, IMSV7_INLAI.STARTDTTM, IMSV7_INLAI.INSPNO INTO mktbl_InspectionAudit
FROM IMSV7_INLAI
ORDER BY Rnd([IMSV7_INLAI].[INSPNO]);

but obviously instead of Top 5000 I want to put in my percentage.

Any idea how to enter a percentage into a query such as this?
 
omg THAT simple =(

Never came across percentages in sql query before.

Many thanks Remou.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top