更新时间:2023-11-29 13:12:34
函数SQLDate(d)
SQLDate = WorksheetFunction。文字(d,yyyy-mm-dd hh:MM:ss)
结束功能
或者
如果登台表是一个选项,你可以使用
TEXT将日期转换为字符串(d,dd mmmm yyyy HH:MM:SS)。一旦数据在临时表中,您可以编写适当的SQL语句以插入到正确的表中。
Function SQLDate(d)
SQLDate = WorksheetFunction.Text(d, "yyyy-mm-dd hh:MM:ss")
End Function
or else
if staging table is an option, you could convert Excel date to string using
TEXT(d,"dd mmmm yyyy hh:mm:ss"). once the data is in staging table, you may write appropriate SQL statement to insert into correct table.