#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default MS Query

I am writing an MS Query and it is working I'm just wondering if I can pass a
parameter to the query from the spread sheet by refrencing a cell.
Something like this
Select transamnt from gldetail where fiscalyear = $A$1
if I hardcode the year in the SQL it works fine,
I guess I can write in VBA but I was trying to take a shortcut?
Any ideas? TIA

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default MS Query

Try specifying a user input parameter in MS Query using [ ] as your
criteria. Return data to MS Excel (specify any valid inout when prompted).
Once back in Excel. right click somewhere in your qury results. Choose
Parameters. Specify that you want the parameter data from a specified cell
(A1). You can also optioanlly specify to automatically refresh the query
whenever the cell value changes.



" wrote:

I am writing an MS Query and it is working I'm just wondering if I can pass a
parameter to the query from the spread sheet by refrencing a cell.
Something like this
Select transamnt from gldetail where fiscalyear = $A$1
if I hardcode the year in the SQL it works fine,
I guess I can write in VBA but I was trying to take a shortcut?
Any ideas? TIA

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
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Importing Data via Web Query - Can values be passed to query? [email protected] Excel Discussion (Misc queries) 5 May 9th 06 06:21 PM
Save data retreived from query without saving query Anthony Excel Discussion (Misc queries) 0 January 25th 06 07:17 PM
Problem with .Background Query option of ODBC Query Shilps Excel Programming 0 April 19th 04 06:41 AM


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