Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Date Time Functions & In-Database Tools

pleicht17
7 - Meteor

I'm able to take information from the last three months by using a filter tool and the custom filter: [field] > DateTimeAdd(DateTimeToday(),-3,"months").

 

This would be more convenient if I use this filter in-database however. But this same custom line does not work. It gives this error:

 

Error: Filter In-DB (3): Error SQLPrepare: [Simba][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: Error while compiling statement: FAILED: SemanticException [Error 10011]: Line 1:144 Invalid function 'DateTimeToday'

 

Is there any way I could get this function to work in-database?

1 REPLY 1
CharlieS
17 - Castor
17 - Castor

The In-DB tool don't use the same formula syntax, or support the same functions as the regular Alteryx tools. They execute their code on the database server, so the formula must be written for the database language. In SQL Server, it will look something like this:

 

DATEDIFF(month,"Field",GETDATE())<3

 

Make sure the input field is formatted properly and that should be it. An example solution is attached.

Labels
Top Solution Authors