I have a SQL query which works in Excel but it uses the following code.
SET QUOTED_IDENTIFIER OFF
SELECT *
FROM OPENQUERY (
INSQL,
"SELECT DateTime = convert(nvarchar, DateTime, 21), [TagName]
FROM WideHistory
WHERE wwRetrievalMode = 'Cyclic'
AND wwCycleCount = 100
AND wwVersion = 'Latest'
AND DateTime >= '20161122 08:33:00.000'
AND DateTime <= '20161122 08:38:00.000'"
)
I am trying to add the DateTime
through an Excel cell. Reading through forums, it mentioned that parametrizing OPENQUERY
is not as straightforward as normal SQL queries in Excel.
Is there anything I can do to link a cell in Excel where I can change these parameters from?