PC Review


Reply
Thread Tools Rate Thread

change date in a sql statement from a cell

 
 
CAM
Guest
Posts: n/a
 
      17th Mar 2010
Hello,

I am using Excel 2007 I have a pivot table that gets refresh everyday. The
data from the pivot table is based on a sql statement, which the data is
connected to a AS/400 table. Here is my problem every morning I go in the
connection properties and change the SQLstatement (date) in the command
text. I don't want my user to do this. What other option can I do? I was
thinking change the date in a cell (A1) and somehow the SQL statement picks
up the new date or maybe some sort of parameter, but I am clueless in how to
do this. Any tips or website to visit I will appreciate. Thank you in
advance.

Regards,


 
Reply With Quote
 
 
 
 
colin_e
Guest
Posts: n/a
 
      22nd Mar 2010

Have a look for Query Paramaters (or Parameter Queries) in the help or on
Google. I have basically the same problem myself, and this is the way I hope
to solve it. If it works it shouldn't be necessary to write any VBA code ;-)

Sadly I haven't actually had time to work on it yet, but i've had a look at
the examples and it looks good. basically you should be able to define your
SQL query with the date as a parameter that is pulled from a cell in the
sheet.

Good luck ;-)

"CAM" wrote:

> Hello,
>
> I am using Excel 2007 I have a pivot table that gets refresh everyday. The
> data from the pivot table is based on a sql statement, which the data is
> connected to a AS/400 table. Here is my problem every morning I go in the
> connection properties and change the SQLstatement (date) in the command
> text. I don't want my user to do this. What other option can I do? I was
> thinking change the date in a cell (A1) and somehow the SQL statement picks
> up the new date or maybe some sort of parameter, but I am clueless in how to
> do this. Any tips or website to visit I will appreciate. Thank you in
> advance.
>
> Regards,
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statement, change cell only if true laavista Microsoft Excel Worksheet Functions 4 29th Apr 2010 04:11 PM
Excel 2003 make 1 date cell automatically change another date cell Scotty Microsoft Excel Worksheet Functions 3 22nd Apr 2010 06:15 AM
date in Cell to change colors if the date is beyond today's date Pete Elbert Microsoft Excel Misc 2 6th Jun 2009 06:31 AM
How to use a specified date by user and output it in another cell using if statement drewmacher Microsoft Excel Worksheet Functions 1 18th Mar 2004 04:43 AM
If Statement to change the cell shading, Jason Microsoft Excel Worksheet Functions 1 11th Jul 2003 02:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:35 AM.