Alteryx Designer Desktop Discussions

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

Alteryx Date Query to Data in Athena

Fescobar
8 - Asteroid

Hello Everyone,

 

I am using the query below and Athena does not like it.

where captured_date (between to_number(dateadd(month,-3getdate()),'99999999') and to_number(dateadd(month,-1,getdate()),'99999999'))

 

I was expecting the last three months of data to be returned.

 

The error that Alteryx returned is:

Error Message: line 17:22: mismatched input 'between'. Expecting: <expression>

4 REPLIES 4
JarekSkudrzyk
11 - Bolide

@Fescobar 

Is in it the bracket "(" before between and not after it?
where captured_date between (to_number...

Fescobar
8 - Asteroid

Thank you for replying .@JarekSkudrzyk

 

I am not sure that I follow what you're stating?  Do you mean that I need to add " (double quotations) somewhere?

 

Thank you,

Fausto

JarekSkudrzyk
11 - Bolide

@Fescobar 
apologies for not making myself clear.

 

I meant that according to the error message the issue is in 22nd character of the line, which is where "(between..." starts.
I think this opening bracket should be removed

 

Please try this query:
where captured_date between to_number(dateadd(month,-3getdate()),'99999999') and to_number(dateadd(month,-1,getdate()),'99999999'))

danilang
19 - Altair
19 - Altair

Hi @Fescobar 

 

It looks like you're missing a comma between the -3 and getdate() in your first dateadd function   

 

where captured_date (between to_number(dateadd(month,-3getdate()),'99999999') and to_number(dateadd(month,-1,getdate()),'99999999'))

 

Dan

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels