Alteryx Designer Desktop Discussions

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

Can't Filter Dates with In Database Filter Tool

Alayna
8 - Asteroid

Hi, I'm pulling some info from an Oracle database and I'm trying to filter for dates, but I'm not sure how to edit the sql query to not give me an error. For example, this Work_Date column shows as a datetime variable in Alteryx in the "YYYY-MM-DD HH:mm:ss" format. Filtering for '2021-02-01 00:00:00' or '2021-02-01' doesn't work.

 

I tried the To_Char function, and it works to give me the YYYY-MM-DD format, but I can't filter with it since it's a string. I've also tried with and without the single quotes around the date. I have no experience in Oracle SQL and not sure if I'm supposed to be typing it differently in Alteryx? Any ideas?

Capture.PNGCapture 2.PNG

2 REPLIES 2
RolandSchubert
16 - Nebula
16 - Nebula

Hi @Alayna ,

 

I think, WORK_DATE is a date data type, while '2021-01-01'  within the query is a string and needs to be converted to date.  You could try 

 

WORK_DATE > to_date('2021-01-01', 'YYYY-MM-DD')

 

Let me know if it works for you.

 

Best,

 

Roland

 

Alayna
8 - Asteroid

Hi Roland, thank you so much that worked! Didn't realize there was a simple to_date function. Thanks!!

Labels
Top Solution Authors