SSIS - Script Issue creating a DateTime

前端 未结 1 2022
独厮守ぢ
独厮守ぢ 2021-01-28 15:03

I\'m using SSIS to upload data from a CSV file to a table from my database. I try to get 2 strings (one is for the date, the other is for the time) and concat them like this : <

相关标签:
1条回答
  • 2021-01-28 15:43

    You should probably change the format to

    Row.FinalDate = DateTime.ParseExact(datsDateTime, "yyyyMMdd HH:mm", null);
    

    Since your getting dates in yyyymmdd format Dates are stored not as string but as integers .If you want to display the data in dd/mm/yyyy format then you can use ToString() method with a specific format like

    YourDate.ToString("dd/MM/yyyy")
    

    but since you are storing in your database then ,it will be stored as integers Check the Dateformat in your sql server

    dbcc useroptions
    
    0 讨论(0)
提交回复
热议问题