Please tell me about the date type.

NishimuraChinatsu-9854 756 Reputation points
2023-03-06T09:19:38.6466667+00:00

I want to set the date to yyyy-mm-dd.

In the middle of the date, 2023-03-06T00:00:00.0000.... The date is in the form of "2023-03-06T00:00:00.0000....

The settings in the dedicted table are also date, but they are stored in the above form.

When processed in the data flow, it is in the form yyyy-mm-dd.

How can I change it to yyyy-mm-dd?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,381 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Musaif Shaikh 85 Reputation points
    2023-03-06T09:59:50.4833333+00:00

    o change the date format from "yyyy-mm-ddThh:mm:ss.0000" to "yyyy-mm-dd", you can use a Derived Column transformation in your Data Flow in Azure Data Factory.

    Assuming the input date is stored in a column called "inputDate", you can use the following expression in the Derived Column transformation:

    substring(inputDate, 1, 10)
    
    

    This expression extracts the first 10 characters from the inputDate column, which corresponds to the "yyyy-mm-dd" part of the date string.

    Once you've added the Derived Column transformation with this expression, you can map the output column to the target column in your dedicated table that stores dates in the "yyyy-mm-dd" format.

    I hope this helps


  2. Musaif Shaikh 85 Reputation points
    2023-03-06T10:51:11.5166667+00:00

    If the date format is still not being saved correctly in the dedicated table, it's possible that the data type of the column in the dedicated table is not set correctly.

    Make sure that the data type of the column in the dedicated table is set to "date" or "datetime", depending on the specific format that you need to use. If the data type is set to something else, such as "varchar" or "nvarchar", the date formatting may not be preserved correctly.

    Additionally, make sure that the output of the derived column transformation is set to the correct data type as well. You can do this by clicking on the output column in the transformation and selecting the appropriate data type from the "Data type" dropdown.

    If the data type of the output column is not set correctly, the date formatting may be lost when the data is written to the dedicated table.

    pls accept question


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.