Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Conversion error in node Data Stream Out

david2010
5 - Atom

Hi all,

 

I have a problem with my workflow loading data from db to alteryx (Data Stream Out says: Conversion failed when convertingdate and/or time from character string.). In the SQL statement (used in Connect In-DB) I'm converting string to date (see the following example/extract):

Select StartTime... from ... where convert(date,StartTime)>'2017-10-31 00:00:00'

Date format is like you can see 'YYYY-MM-DD HH:MM:SS'.

 

Does anyone has an idea what I'm doing wrong? 

2 REPLIES 2
JohnGD
Alteryx
Alteryx

Hi @david2010!

 

According to this article, the CONVERT function accepts a 3rd optional argument "style" that specifies "the format used to convert between datatypes, such as a date format or string format"

In your case, I'd suggest the value 120, that corresponds to the format "yyyy-mm-dd hh:mi:ss".

 

Your query would be : Select StartTime... from ... where convert(date,StartTime,120)>'2017-10-31 00:00:00'

 

Let me know how it works.

 

John

John Gonggrijp-Dowe
Customer Support Engineer
Alteryx, Inc.

david2010
5 - Atom

Thank you John. That helped!

David

Labels