community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Help with SQL query

Asteroid

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

Alteryx Certified Partner
Alteryx Certified Partner

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.

 

Asteroid

@RolandSchubertthanks for the suggestion, that works!

Labels