In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

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
20 - Arcturus

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
20 - Arcturus

@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