Alteryx Designer Desktop Discussions

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

SQL Query

Ronal_bal
8 - Asteroid

Hi, I'm using In dB tools tp pull the data. I just need to filter on data greater than current date.

I've used this function          'Field_name'>= getdate();


But I'm receiving error has Getdate() is invalid function

7 REPLIES 7
IraWatt
17 - Castor
17 - Castor

Hey @Ronal_bal,

Does 'Field_name'>= CURRENT_DATE work?

Ronal_bal
8 - Asteroid

Yes, that's working. can I know why get data isn't working. Can you guess any reasons?

IraWatt
17 - Castor
17 - Castor

@Ronal_bal Im not a SQL expert but perhaps the version your using or your data base environment doesn't support get data? Do you know what SQL version your using? 

Ronal_bal
8 - Asteroid

Hi,

I'm trying to pull greater than last week Monday's date based on current system date.

I tried 
DATETIME = DATEDIFF(day, 0, GETDATE() – DATEDIFF(day, 0, GETDATE()) %7)

receiving some configuration error. I tried to replace GETDATE() with Current_date.

apathetichell
19 - Altair

what type of database are you running?There can be a good amount of deviation in SQL date function nomenclature.

Ronal_bal
8 - Asteroid

It is hive db.

apathetichell
19 - Altair

@Ronal_balYou need to use the correct syntax for HIVE. This isn't an Alteryx issue - see this post for an example of how to use DateTime in HIVE and adjust for your need...

 

 

https://www.revisitclass.com/hadoop/how-to-get-the-current-date-in-hive-with-examples/

Labels
Top Solution Authors