Query Parameter throws General Error

Zatoichi

New member
Joined
Jul 22, 2020
Messages
2
Reaction score
0
Points
0
Excel Version(s)
Office 13
Set up a query in Excel 13 that works with a hardcoded number, but fails when I pass a parameter. I'm trying to bring in database entries that are more than one day old.

What am I doing wrong?

krntime stores a text string date like this:
07/22/2020 10:09:11.570

SELECT *
FROM RTDB.dbo.remote remote
WHERE krntime < NOW() - 1 <============= WORKS
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]SELECT *
FROM RTDB.dbo.remote remote
WHERE krntime < NOW() - ? <============= [ATI][OpenRDA ODBC]Invalid date/time expression
[/FONT]
 
BTW also tried to use a parameter that points to worksheet cell where the value is = NOW() - 1

Same error
[ATI][OpenRDA ODBC]Invalid date/time expression
 
Back
Top