Datetime with NULL values

Alyssa Bleize 0 Reputation points
2023-03-22T09:44:55.8566667+00:00

Hello,

I have two datetime columns in this format: "20180426173754".
it is from a JSON file and ADF says that is it a timestamp datatype.

But in my JSON file I can see that one column has a datetime datatype and one value has a timestamp datatype.

But I can't see any of my datetime values, everything gives a NULL value in ADF.

Can somebody please help me, because I tried to convert the datatypes to string, date, datetime but nothing works.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,545 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 23,011 Reputation points
    2023-03-22T12:14:57.7866667+00:00

    It's possible that the timestamp format in your JSON file is not recognized by ADF.

    Try the following :

    SELECT FROM_UNIXTIME(timestamp_column) AS datetime_column FROM table_name

    If the datetime values still cannot be read by ADF, try casting them to a different format using the DATE_FORMAT:

    SELECT DATE_FORMAT(datetime_column, 'YYYY-MM-DD HH:MM:SS') AS formatted_datetime_column FROM table_name

    0 comments No comments

Your answer

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