Alteryx Designer Desktop Discussions

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

Filter Date In-DB

jojocuchiaro
5 - Atom

Hello!  I am trying to filter for dates <= 2017-12-31. I tried "Date" <= TO_DATE('2017-12-31', 'YYYY-MM-DD')

among others, but get this error message: 

 

Error SQLExecute: [Simba][Athena] (1040) An error has been thrown from the AWS Athena client. Error Message: INVALID_FUNCTION_ARGUMENT: Failed to tokenize string [Y] at offset [0] [Execution ID: 340a7506-4d1c-4b46-8824-51942197991d]

 

The data is coming from AWS Athena, but the In-DB connection is set up as a Generic ODBC. 

 

Thank you in advance!

4 REPLIES 4
mbarone
16 - Nebula
16 - Nebula

Are you sure that's the right syntax for that database?  Also, have you tried brackets around Date (so it's [Date])?

Jean-Balteryx
16 - Nebula
16 - Nebula

Hi @jojocuchiaro ,

 

As @mbarone mentioned I think that's not the right function to use. From what I found, TO_DATE is used for Amazon Redshift and for Amazon Athena, you should use DATE_PARSE function.

 

Can you try this : 

date_parse('2017-12-31','%Y-%m-%d')  

 

john_watkins
11 - Bolide

When doing anything with In-DB tools it is very helpful to have a console open to allow you to write and test the SQL and then copy/paste into Alteryx.  Alteryx will tell you it errored, but most of the time the debugger and errors will be better in the actual console.  If it doesn't run in the console, it won't run in Alteryx either.

malkiewicz
5 - Atom

This worked for me! Thank you very much!

Labels