Share via

Help on Case or If statement

sam nick 366 Reputation points
2021-05-21T17:49:57.85+00:00

Hello,
I have a date field in my source CSV which has values like

1/1/2021
1/5/2021 02:05:23
N/A
00h:00m:23s

The field datatype on the destination (SQL table) is datetime. For those records that dont look like date or datetime, i want to put the field empty or NULL. Is there a way to accomplish this via a derived column as i'm using a Dataflow for other transformation. So the data into the table should be

1/1/2021 00:00:00
1/5/2021 02:05:23
NULL
NULL

Please could you help on how to accomplish this.
Thank you.

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


1 answer

Sort by: Most helpful
  1. Mark Kromer MSFT 1,146 Reputation points
    2021-05-21T19:35:09.433+00:00

    iif (isDate(column1),column1,toString(null()))

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.