Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
brewabel
 
Posts: n/a
Default Query of an SQL Database


I have a query made to pull information in from a SQL database. From
time to time, this query exceeds the the 65,000 row limitation. So the
question is kind of two part.

1. How can I limit the query to only pull 65,536 rows of data?

2. How can I force the query to start dumping to a new worksheet once
the first one has reached it's capacity?

Thanks.


--
brewabelPosted from http://www.pcreview.co.uk/ newsgroup access

  #2   Report Post  
TomHinkle
 
Posts: n/a
Default

Use this clause in the sql of the query (go to the SQL window)

Select Field1, Field2 from table A;

becomes

Select top (x) field1, field2 from table A.

As for the second part, I believe you'll have to make code to scroll through
a recordset. Once you reach row 65536, start on another worksheet.


*** I would say that with newer versions of excel you can make pivot tables
DIRECTLY from external data (ie queries in access) or make an 'olap cube'
(look at the help for that one).

I'd explore one of those options. probably help you reach your true goal
easier.

"brewabel" wrote:


I have a query made to pull information in from a SQL database. From
time to time, this query exceeds the the 65,000 row limitation. So the
question is kind of two part.

1. How can I limit the query to only pull 65,536 rows of data?

2. How can I force the query to start dumping to a new worksheet once
the first one has reached it's capacity?

Thanks.


--
brewabelPosted from http://www.pcreview.co.uk/ newsgroup access


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Query -- Data Type Mismatch StephenP Excel Discussion (Misc queries) 0 April 14th 05 07:05 PM
HELP! Lose Database Query upon Refresh Magela Excel Worksheet Functions 0 April 1st 05 09:11 PM
Excel Database Query String Too Long Karl Burrows Excel Discussion (Misc queries) 4 January 27th 05 06:25 AM
Query a Access database that has a module from Excel Oggie Excel Discussion (Misc queries) 1 January 4th 05 08:43 AM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM


All times are GMT +1. The time now is 03:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"