Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.