Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Replacing Date in SQL Code with Interface Date Tool

Allan_F
7 - Meteor

I am working on creating a simple Analytics App for our Leadership to run on their own without my Data Team having to run a new SQL Query for them each time. The SQL Query is as below:

 

SELECT SO.*, SOD.* FROM dbo.SystemOrderDetail SOD With(NoLock)
LEFT JOIN dbo.SystemOrder SO With(NoLock) on SOD.SystemOrderID = SO.SystemOrderID
WHERE SOD.CreateDate > '05/30/2021'
AND (SOD.[Description] LIKE '%Lively Flip Open%' OR SOD.[Description] LIKE '%Lively Smart Open%')

 

I want to use the Interface Date Tool to replace the date within:

WHERE SOD.CreateDate > '05/30/2021'

 

I have been unable to make this work either through Value or Formula replacement. Interface Date Tool input is attached.

3 REPLIES 3
apathetichell
18 - Pollux

Hi - you need to expand your action tool and find the specific part of the input tool (ie probably FormatSpecificOptions) which references the "WHERE SOD".CreateDate" line in your Querry. You want that part highlighted in your action tool and then your formula should work assuming that the date format you are setting works with your DB.

Allan_F
7 - Meteor

I appreciate your help, I was unable to get the replacement to work directly from the Date Interface into the Dynamic Input which held the SQL Code.
What did work was connecting a Input Data Tool to the Date Interface prior to the Dynamic Input.

apathetichell
18 - Pollux

Good to hear - should have clarified that when I said "Input Tool," I meant Input Data Tool.

 

also - date tool to action tool to Input Data Tool should work - dynamic input may be even be needed depending upon what you are doing.

Labels