Extract first 30% of records

  • Thread starter Thread starter Jason Morin
  • Start date Start date
J

Jason Morin

Hello. A user here has a table where she needs to extract
only the top 30% of records. The table is already sorted,
but the issue is that the # of records in the table is
dynamic - it could be 1000, 5387, or whatever. So if it
is 1000, she needs to pull records 1-300 (all fields). If
it 5387, she needs records 1-1616. Is this achievable with
just a query?

Thank you.
Jason
 
Hi Jason,

Try:
SELECT TOP 30 PERCENT Table1.*
FROM Table1;

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."


--------------------
| Content-Class: urn:content-classes:message
| From: "Jason Morin" <[email protected]>
| Sender: "Jason Morin" <[email protected]>
| Subject: Extract first 30% of records
| Date: Tue, 3 Feb 2004 07:31:56 -0800
| Lines: 10
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcPqats8FNmXGqzUR02AmlcmZiEu7w==
| Newsgroups: microsoft.public.access.queries
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.access.queries:188546
| NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
| X-Tomcat-NG: microsoft.public.access.queries
|
| Hello. A user here has a table where she needs to extract
| only the top 30% of records. The table is already sorted,
| but the issue is that the # of records in the table is
| dynamic - it could be 1000, 5387, or whatever. So if it
| is 1000, she needs to pull records 1-300 (all fields). If
| it 5387, she needs records 1-1616. Is this achievable with
| just a query?
|
| Thank you.
| Jason
|
 
Back
Top