In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Dynamically changing the start time and time of SQL query

Divyaranga
5 - Atom

My question is

 

When I give a SQL statement.

 

Select * from MoneyTransactions where recordtime>='2021-05-01 00:00:00' and recordtime<='2021-05-07 23:59:59'.

 

I want to dynamically change the recordtime   recordtime>='2021-05-08 00:00:00' and recordtime<='2021-05-14 23:59:59' 

 

and so on. How can I do this in Alteryx?

4 REPLIES 4
mceleavey
17 - Castor
17 - Castor

Hi @Divyaranga ,

 

If you want to dynamically change these values based on datetimenow(), for example, or by other logic, then you can put your input tool with the SQL script in a macro and feed these values in as control parameters which can then overwrite the value in the SQL script in an action tool.

 

Alternatively, if you would like the user to input these values then you can build an analytic app using the interface tools to update the values in the SQL script from a datetime picker.

 

It depends on the use case.

 

M.



Bulien

Divyaranga
5 - Atom

Many Thanks. Can I get a workflow for my SQL query using the dynamic input tool. Thanks in Advance

mceleavey
17 - Castor
17 - Castor

@Divyaranga ,

 

you will need to provide your input tool with the SQL script so I can build that for you.

 

M.



Bulien

Divyaranga
5 - Atom

Sure I will provide the required inputs.

Labels
Top Solution Authors