Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Expressions in Error Message Tool

kas
8 - Asteroid

Hello,

 

I am trying to use the Error message tool in conjunction with Interface tools to have it return an error message when they select a date outside of a time frame for the Start Date. That time frame is no earlier than the 1st of the year 3 years prior. So currently that would be 1-1-2022, but next year it will be 1-1-2023 and so forth each year, so it can't be a set date. The SQL query is set to restrict the data from not going back further, but they will need to be able to select date ranges within that time frame. I've used this tool before, but with a set date so it was easier.

Screenshots of the Error message tool (current expression works only during 2025), Interface tools, and SQL query portion that restricts data as reference below.

 

 

Error message config.pngInterface tools.pngSQL date portion.png

 

Thank you,

Kim

15 REPLIES 15
kas
8 - Asteroid

@alexnajm 

 

I had tried the following:

>DateTimeAdd(DateTimeFirstOfMonth(), -6, "months")

 

But when I tested with a date selection further back than 6 months, the error message didn't pop up.

 

Tried your version, and same, error message doesn't come up.

alexnajm
18 - Pollux
18 - Pollux

Worked fine for me! You said six months beyond today right? so six months into the future would be +6 months, not -6 months...

Screenshot 2025-07-11 093009.png

kas
8 - Asteroid

@alexnajm 

 

Not into the future, but not more than 6 months back (that's why I put -6)

😊

alexnajm
18 - Pollux
18 - Pollux

Ah "when the date is more than 6 months from the current date" sounded like future not past!

 

Then flip the greater than to less than and use the negative number

kas
8 - Asteroid

@alexnajm 

 

OK...thanks for bouncing back and forth with me!

 

I totally forgot to flip it to the less than symbol at the beginning...but, also it needs to be left at a positive '6' and it works!

 

Thanks again for all your patience!!

alexnajm
18 - Pollux
18 - Pollux

Happy to help!

Labels
Top Solution Authors