Can't Filter Dates with In Database Filter Tool
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Roland, thank you so much that worked! Didn't realize there was a simple to_date function. Thanks!!
