Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default calendar control - pivot table input variable

Hi I created active x calendar control. I started
record macro caught the pivot table build code, with a
where on a date field. calling odbc from sql2000 server
I am trying to use the pick date from the calendar
control as the start date in the where clause
so the control would be = start_date and <= (startdate +
7)
If that can work then put in an imput field for the start
date plus input field.

Last is there anything around about embeding excel into
asp.net?

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default calendar control - pivot table input variable

Frankly, I don't undersatnd what you wrote.

Think about what it is that you need and try to ask a
question about it again.

If your question is about extracting data from a SQL
database to a Pivot table, the do NOT use ODBC.
Use ADO. Create a connection object and connet it to the
database.
opena recordset with your sql script to get the data from
the database. set the pivot caches RECORDSET property to
this recordset.


Here is some sample code that connects to a database then
creates a pivot table

dim ws as worksheet
Dim oConn As ADODB.Connection
Dim orst As ADODB.Recordset

set ws = worksheets.add

Set rTarget = ws.Range("C3")

sql = sMYSQL


' create objects
Set oConn = New ADODB.Connection
Set orst = New ADODB.Recordset

' connect to the database
With oConn
.ConnectionString = "PROVIDER=MSDASQL;" & _
"driver={SQL Server};" & _
"server=%server%;uid=;pwd=;" & _
"database=%database%;"
.CommandTimeout = 60
.Open
End With


' fetch the data
orst.CursorLocation = adUseClient
orst.Open sql, oConn, adOpenDynamic, adLockOptimistic

' create the pivot cache
Set ptc = ActiveWorkbook.PivotCaches.Add(xlExternal)
' populate the cache the create the pivot table
Set ptc.Recordset = rst
Set PT = ptc.CreatePivotTable(rTarget, "MyPivot")









Patrick Molloy
Microsoft Excel MVP






-----Original Message-----
Hi I created active x calendar control. I started
record macro caught the pivot table build code, with a
where on a date field. calling odbc from sql2000 server
I am trying to use the pick date from the calendar
control as the start date in the where clause
so the control would be = start_date and <= (startdate

+
7)
If that can work then put in an imput field for the

start
date plus input field.

Last is there anything around about embeding excel into
asp.net?

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
Grouping Dates in a Pivot table for years that are not calendar ye Uno Excel Worksheet Functions 1 June 4th 08 02:57 PM
Input cell reference is not valid (One Variable Data Table) Dottore Excel Worksheet Functions 9 September 1st 05 03:05 PM
Input Cell in One variable data table Dottore Magistrale Excel Worksheet Functions 0 August 30th 05 06:25 PM
Calendar Control: Can't exit design mode because control can't be created Rone Excel Programming 0 May 24th 04 04:01 PM
Pivot Table - Object variable or with block variable not set? George Nicholson[_2_] Excel Programming 1 April 16th 04 09:12 PM


All times are GMT +1. The time now is 06: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"