Alteryx Designer Desktop Discussions

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

[Query][MySQL] Query error in Alteryx SQL Editor - To_date function

Joker_Hazard
11 - Bolide

Hello all, I'm new at SQL so I have been struggling with To_Date function! 

Thats the error: 

Joker_Hazard_0-1618085159803.png

Date format in the database is like this:

Joker_Hazard_1-1618085472371.png

Any ideias?

thanks in advance!

 



4 REPLIES 4
danilang
19 - Altair
19 - Altair

Hi @Joker_Hazard 

 

Change the format string in the To_Date function so that it matches the input string.

 

To_Date('2018-01-01 00:00:00', 'yyyy-mm-dd HH24:MI:SS')

 

Also note that in Oracle, HH24 is the format string for represents hours from 0-23.  If you use HH, you also need the AM/PM specifier.  Since this isn't in you data, use HH24

 

Dan

Joker_Hazard
11 - Bolide

Hey, Dani thanks for the reply! 

I got the same error, am I doing something wrong?

Joker_Hazard_0-1618144172094.png

 

danilang
19 - Altair
19 - Altair

@Joker_Hazard 

 

Because of the number of fields that your selecting, the actual error message that your getting isn't displayed in the dialog box.  Create a simple query selecting only one field from and try that.  The ultimate goal is to the see the text of the error message.  

 

Dan

Joker_Hazard
11 - Bolide

The error was because I was trying to convert the date with no reason, with "to_date".

My goal was to just FILTER the dates, so I just used >= '2018-01-01".

thanks for the help

Labels