none
How to Convert MMDDYYYY to YYYYMMDD

    Question

  • Hey All.

    Can any one help me to convert date formate MMDDYYYY to YYYYMMDD.

    Actually I'm running SSIS (ETL) package. I got source file from client, in that source file one column called "Date Status" wit MMDDYYYY format. But I want to convert that format to YYYYMMDD and  import into staging table.

    Thank You!

    Tuesday, June 19, 2012 2:01 PM

Answers

All replies

  • Tuesday, June 19, 2012 2:11 PM
  • When I have SQL as Source I generally use T-SQL to convert to ISO date SQL YYYYMMDD

    Take care 

    Emil

    Tuesday, June 26, 2012 5:50 AM
  • Please use the one derived column with expression in SSIS

    bornsql

    Tuesday, September 11, 2012 6:11 AM
  • I suggest you conver the field into datatime value format. So later you can choose any presentation format you prefer in your application. And since SQL Server 2008, you can use data type date which takes only 3 bytes, compared with 8 bytes if you save the value in char. And when you save the value in datetime, you can use lot of native functions for datetime date type, like DATEDIFF, DATEADD etc. And you can also use functions like SWITCHOFFSET to change the universal time to local time easily. For some other practices, use a 4 bytes integer in YYYYMMDD format and provide a date dimension tables is also acceptable.

    Monday, September 24, 2012 3:05 AM