Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Help with SQL query

mb1824
9 - Comet

Hi,

 

I have a workflow with an SQL query as an input that returns about 50,000 records.

 

The results have 2 'Conv Errors' as below - I would like to modify the query so that values like this are automatically replaced with blanks/nulls (I know these errors are nothing to worry about but someone else may not).

 

Alteryx_Conv errors.JPG

 

I have tried replacing 'date_inv_u' in the SQL statement with the below:

 

...,Case date_inv_u When '0001-01-01 00:00:00' Then '' Else date_inv_u End As date_inv_u_test,...

The workflow runs without any errors, but the results are odd. See below. What am I doing wrong?

 

Alteryx_Fix Conv errors.JPG

2 REPLIES 2
RolandSchubert
16 - Nebula
16 - Nebula

Hi,

 

try to replace ' ' with NULL in your SQL statement:

...,Case date_inv_u When '0001-01-01 00:00:00' Then NULL Else date_inv_u End As date_inv_u_test,..

 

I think ' ' in SQL query will return '0001-01-01 00:00:00' , so it does not replace the wrong entry.

 

mb1824
9 - Comet

@RolandSchubertthanks for the suggestion, that works!

Labels