Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.links,microsoft.public.excel.querydao,microsoft.public.excel.worksheet.functions,microsoft.public.sqlserver.connect
Duke Carey
 
Posts: n/a
Default Variable SQL Statements pulling from a cell in Excel

Well, Ardus

That's something I hadn't stumbled on before and find it very helpful
Thanks

"Ardus Petus" wrote:

Use :
SELECT * FROM TABLE WHERE YEAR = ?

Close Microsoft Query and get back to Excel

In popup window, select Parameters...

HTH
--
AP

"Preacher Man" <nospam a écrit dans le message de
...
I have a situation that I hope someone can give me a good answer to.

Please
bear with me as I try to explain my needs.

My goal is to have an Excel spreadsheet that pulls from a SQL database and
the the query pulls from a variable in the Excel sheet. For example let's
say I am pulling Sales Orders from SQL, let's also simply assume the

record
has two fields Year and SOno.

Under a simple query I could say Select * from table. Of course that

would
pull all so's from every year.

To filter the query of course I could say Select * from table where
year='2006'. And naturally that would give me 2006 orders.

OK, here's where I can't figure this out. I want the query to filter
according to a value in a cell in excel. Let's use cell A1. Essentially

I
am looking for a query that says "Select * from table where Year=(Cell A1

in
the Sheet)"

Is this possible?





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
Automatically Changing Cell Reference's when Pasting in Excel No I'm Spartacus Excel Discussion (Misc queries) 0 February 13th 06 02:01 PM
I want to use a formula in excel to highlight a cell 30 days prio MWad22368 Excel Worksheet Functions 1 February 13th 06 03:51 AM
Input Cell in One variable data table Dottore Magistrale Excel Worksheet Functions 0 August 30th 05 06:25 PM
copying cell names Al Excel Discussion (Misc queries) 12 August 11th 05 03:01 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM


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