dateRange problem

I write Sql:

SELECT Hum,Temp,Pressure,t_stamp
FROM table
Where t_stamp >= ‘{StartDate}’ AND
t_stamp <= ‘{EndDate}’

Problem is
WARN: Simple Query could not be completedIncorrect DATETIME value: ‘Wed Dec 11 07:39:56 EST 2019’

How to fixed it. Thank you very much

Curly braces in Ignition’s queries just do a string substitution, using the default string conversion for whatever is inside the curly braces. Use a named query to pass complex types like dates directly to the DB via JDBC parameters. This avoids the string conversion. The reporting module also allows ‘?’ substitution (like the system.db.Prep() script functions) which also pass parameters without converting to strings.

If you cannot avoid the string substitution, you will have to convert the dates to strings yourself in a format your database likes. This varies by database brand.