how to import excel datetime column into database

as title, my excel column logintime previously let it transimit to be text(String) into database successfully.

However, if i want it directly insert into datetime format always fail, the example shows in excel as "2019/11/28  8:08:27"

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    another idea is to load the excel into a staging table of sorts with the columns being strings. Then run a stored proc to loop through and move the data. when doing that you can format / cast the string to datetime since it is in a known format. Just a thought if you continue to encounter struggles or are afraid people will remove the format on the column in the excel.

Reply
  • 0
    Certified Lead Developer

    another idea is to load the excel into a staging table of sorts with the columns being strings. Then run a stored proc to loop through and move the data. when doing that you can format / cast the string to datetime since it is in a known format. Just a thought if you continue to encounter struggles or are afraid people will remove the format on the column in the excel.

Children
No Data