AnsweredAssumed Answered

Update SQL - Date format wrong?

Question asked by sebasnn86 on Oct 8, 2018

Hi, 

We are updating a MS SQL table using a simple query to update the date in some record from a workflow.

 

When we run it manually (using the Execute Now within the Execute SQL action) it works as expected, but when it runs from the Worfklow it inverts the date (from dd/mm/yyyy to mm/dd/yyyy, only when the day is less tan 12, indicating that it can tell between day and month since there's only 12 months) and we don't know why.

 

Our query:

UPDATE Table

SET DATEFIELD = CONVERT(DATETIME,'04/11/2018',103)

WHERE ID = XXX

 

Manually this ends up being November 4th, but when it executes from the WF, we end up getting April 11th.

 

The query within our Execute SQL action is:

UPDATE Table
SET DATEFIELD = CONVERT(DATETIME,'{ItemProperty:Date}',103)
WHERE ID = {WorkflowVariable:PK}

 

Whenever we log ItemProperty:Date, it logs 04/11/2018 as a string, maybe the behavior is different for this action??

 

What are we missing?

 

Thanks!

Outcomes