community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
#SANTALYTICS

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More
SOLVED

Updating a SQL Query in an App

Asteroid

Hello!

 

I have an analytical app in which I would like to use the Date Prompt Tool to allow a user to select a date.  Then, that date will be used to update a value in a where clause in a SQL query.  I have tried approximately one million things, and I cannot get it to work.  Can anyone assist?  Please let me know what additional information you need.  

 

Thank you!

Alteryx Certified Partner
Alteryx Certified Partner

Hi @Jennifer 

 

It should be a very simple task - You put a Date Interface Tool and connect that to your Input or Connect In-DB tool.

 

Then use the "Update Value" in your Query Expression and check "Replace a Specific String" right into the date in your original query.

 

Could you please share your workflow, or a picture so we can understand it better?

 

Cheers,

Alteryx Certified Partner
Alteryx Certified Partner

@Jennifer,

 

I want to tell you the secret, but I don't want to make this look too easy.  You might be doing this as an in-db tool connect or as a standard input tool reading from your database.  I'll answer this as a standard input tool.

 

I like to use a DYNAMIC INPUT tool for SQL parameter updates.  You can copy your SQL from the input tool and setup a dynamic input tool.  The tool will first ask you to setup a template.  Go ahead and configure the template EXACTLY as you did in the Input tool (using your copied SQL).  Next you can put a TEXT INPUT tool in front of the dynamic input.  The TEXT INPUT will have a DATE_PARAMETER field that contains a properly formatted date (e.g. 2019-03-29).  

 

Now you can read in the date and *Modify SQL Query

 

You'll add to update the WHERE clause and update your "fixed" SQL date with the value from the date parameter.

 

If you have any issues, please let me know.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Asteroid

Hello,

 

So, I ended up just making a silly error.  I had the action tool connected to the dynamic input.  I switched it so it was connected to the text input tool and it works fine now.  

 

I appreciate your assistance!!

 

Thank you!!

Atom

hi, I did the exact same thing, my workflow works but the query isn't filtering when I choose a date. can you please share the workflow so I can see the interface settings and details?

 

thanks :)

Alteryx Certified Partner
Alteryx Certified Partner

@asmukar 

 

Are you clicking at the magic wand? You have to do that to run as an App.

 

Cheers,

Labels