Support 3 parameter datepart in SQL

Jason
Jason Registered Posts: 33 ✭✭✭✭✭

The DatePart function allows 3 parameters when used in the DSS engine. The third parameter is the timezone from which you want the value to be reported (example, if I want the "Hour" value of a date time, but I need it in "US Mountain Time Zone" rather than in UTC).

When calling this function as part of a recipe that must run with the SQL engine, the system reports an error: Recipe cannot be translated to SQL: Wrong number of arguments given to SQL function DATEPART: 3

It is possible to implement this because MSSQL supports this with the following syntax:

datePart(hour, <time column name> AT TIME ZONE 'US Mountain Standard Time')

1
1 votes

New · Last Updated

Setup Info
    Tags
      Help me…