Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Limiting Date Interfaces' Date range

SergioWW
6 - Meteoroid

Hello,

 

I am creating an application that allows a user to select a date via the Date interface tool. I want to limit the user's ability to select a date that is 13 months prior to the present date (DateTimeNow()). Does this feature exist within the Date interface tool?

 

Thanks for your help!!

2 REPLIES 2
Maskell_Rascal
13 - Pulsar

Hi @SergioWW 

 

You can connect the Date Interface Tool to an Error Message Tool to throw an error message and halt the app/macro from running. Here is one that I built to verify that the start date was not greater than the end date. 

 

Maskell_Rascal_0-1615414862780.png

 

Maskell_Rascal_1-1615414887123.png

 

For the expression, you could use something like. 

DateSelected <= DateTimeFormat(DateTimeAdd(DateTimeToday(),-13,"months"),'%Y-%m-%d')

 

DateSelected in the above would need to be your line into the error message tool, but the rest of the formula is continuously calculating 13 months back from todays date. 

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Thanks!

Phil

SergioWW
6 - Meteoroid

This worked perfectly! Thank you!

Labels