Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Pivot Table based on SQL Server query


I have a pivot table based on a SQL Server view. The data from the view
(basic select with no where clauses) which is stored in "Sheet1"

I created the Pivot table, selecting the "Create New Worksheet" putting the
Pivot Table on Sheet4.

If I select "Refresh Data" on the Pivot Table (Sheet4), it doesn't actually
refresh the data in Sheet1 (i.e. re-running the select from the database) it
only refresh's the Pivot Table from the data already contained in Sheet1,
effectively doing nothing.


The workaround is to go to Sheet1, select "Refresh Data" which querys the
database, then go to Sheet4 & select "Refresh Data" which refresh's the
Pivot Table contents.

I *used* to be able to refresh directly from Sheet4 which re-ran the db
query & updated the Pivot Table in one go..

How is this done?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Pivot Table based on SQL Server query

Dunno but you could try this in Sheet4

Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Sheet1.QueryTables(1).Refresh
End Sub

Hth,
Oli

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Pivot Table based on SQL Server query

hmm..

you could have created a pivottable on a sql query directly.
However you made a query table and made a pivot on the query table's
results.

the first option may have been be smarter. NO intermediate excel range
taking up space and refreshing would directly query the databse.

In your situation you have to refresh the QUERYtable first.
(in theory this SHOULD refresh the PivotCache too...)


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Ben Rum wrote :


I have a pivot table based on a SQL Server view. The data from the
view (basic select with no where clauses) which is stored in "Sheet1"

I created the Pivot table, selecting the "Create New Worksheet"
putting the Pivot Table on Sheet4.

If I select "Refresh Data" on the Pivot Table (Sheet4), it doesn't
actually refresh the data in Sheet1 (i.e. re-running the select from
the database) it only refresh's the Pivot Table from the data already
contained in Sheet1, effectively doing nothing.


The workaround is to go to Sheet1, select "Refresh Data" which querys
the database, then go to Sheet4 & select "Refresh Data" which
refresh's the Pivot Table contents.

I used to be able to refresh directly from Sheet4 which re-ran the db
query & updated the Pivot Table in one go..

How is this done?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Pivot Table based on SQL Server query


"keepITcool" wrote in message
.com...
hmm..

you could have created a pivottable on a sql query directly.
However you made a query table and made a pivot on the query table's
results.


Bingo! Thanks.


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
Finding the Access query a pivot table is based on ChuckW Excel Discussion (Misc queries) 1 March 21st 08 04:13 PM
get SQL Server text data type into Excel pivot table Lee@360Commerce Excel Discussion (Misc queries) 0 August 19th 05 11:37 PM
How do you get a pivot table to do server-side processing? [email protected] Excel Programming 4 October 15th 04 07:14 AM
Excel Pivot Table from SQL Server JimR[_2_] Excel Programming 0 May 28th 04 03:36 AM
SQL Server 2000 - Pivot Table Piper[_2_] Excel Programming 0 August 17th 03 09:24 PM


All times are GMT +1. The time now is 02:25 PM.

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

About Us

"It's about Microsoft Excel"