Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following code that returns the needed data into excel and manually changing the date will change the returned data; however, I'd like to reference a cell with a formula that will make the query a bit more user friendly.

I've tried using my limited knowledge of referencing a cell but none have worked. This information is in cell A1 and the query is placed in cell A2 with the following equation: =wwQuery("STKAP03", $A$1)

SET QUOTED_IDENTIFIER OFF
SELECT * FROM OPENQUERY(INSQL, "SELECT DateTime, [40_MOTORS.MI436423.CIN], [40_MOTORS.MI436425.CIN]
FROM WideHistory
WHERE [40_MOTORS.MI436423.CIN] IS NOT NULL 
AND wwRetrievalMode = 'Delta'
AND wwVersion = 'Latest'
AND DateTime >='20120409 07:00:00' These two dates/times I'd like to reference cells on a different sheet
AND DateTime <= '20120416 07:00:00'")
share|improve this question

You must log in to answer this question.

Browse other questions tagged .