Where property of erp-baq for date conditions

Hi All,

I’m using the erp-baq widget to call a BAQ and getting an error when the BAQ executes. The error: Ice.Common.EpicorServerException: Conversion failed when converting date and/or time from character string.

In the where property, I have the following:

(OrderHed_OrderDate >= '{DataView1.FiscalPer1_StartDate}' and OrderHed_OrderDate <= '{DataView1.Calculated_SelDate}')

In the dev console Network > Payload log, I can the where clause is being resolved as:

((OrderHed_OrderDate >= ‘Wed Sep 01 2021 00:00:00 GMT-0700 (Pacific Daylight Time)’ and OrderDate <= ‘Tue Sep 21 2021 00:00:00 GMT-0700 (Pacific Daylight Time)’))

The response is an error: “Bad SQL statement. Review the server event logs for details.”

In the server event log, I am seeing:
Ice.Common.EpicorServerException: Conversion failed when converting date and/or time from character string.

Apparently sql server is not able to interpret that date string to resolve the query.
What am I missing?

Solved by adding calculated fields of type string for the dates and used those in the where clause instead of the actual date fields.