Pulling date range out of report table

Here is my code. Parameter TimeHolder is set to now(). I get an error: WARN: Simple Query could not be completed. Incorrect syntax near ‘Sep’ which is the current month but I don’t know how to correct it. I can tell that the date is being extracted but this error provides nothing to help me. I have looked at all the blogs and ignition discussions but none have been specific to this or worked. DTReport is my downtime report and t_stamp is the time stamp column of my report. I only want to extract the last 8 hours of input to the table. If someone also knows how to extract only a certain number of rows that would also be helpful since none of the online info has helped.

SELECT * From DTReport
where t_stamp >= dateArithmetic({TimeHolder}, -8, “hour”)
and t_stamp <= {TimeHolder}
order by t_stamp desc

Brace-delimited substitution in SQL in Ignition is a simple string conversion, with the result going straight to your database for its syntax parser. If you cannot use ‘?’ substitution, you must handle all of the string formatting and value quoting that your DB will need to get TimeHolder in a format it accepts.

Things like dateArithmetic() are being sent to your DB, not executed in Ignition. You’ll have to compute that as a parameter, too.

Both timestamp formatting and row limiting vary by DB brand. What DB are you using?

Microsoft SQL Server. I am not a python programmer but am trying to get informed. I have already created a table with changing dropdowns so selections can be made based on previous selections and i have created a search function to isolate items in the table. The last function i am trying to accomplish is emailing downtime reports every 8 hours to supervisors. I have the email function working but just need to isolate data from the last 8 hours based on the timestamp of the entry.