You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently had to export a table from MS SQL Server that had individual date and time columns. sqltocsv exports both columns as time stamps (date + time). The resulting date column in CSV has 2018-05-02 00:00:00 +0000 UTC and time column is 0001-01-01 13:24:02 +0000 UTC.
The attached sqltocsv.go file has a crude hack that formats the results as time if the date is null (0001-01-01) and as date if otherwise.
There are definitely better ways to do this, but it worked for me. Hope this is useful to someone.
I recently had to export a table from MS SQL Server that had individual
date
andtime
columns.sqltocsv
exports both columns as time stamps (date + time). The resulting date column in CSV has2018-05-02 00:00:00 +0000 UTC
and time column is0001-01-01 13:24:02 +0000 UTC
.The attached sqltocsv.go file has a crude hack that formats the results as time if the date is null (0001-01-01) and as date if otherwise.
There are definitely better ways to do this, but it worked for me. Hope this is useful to someone.
sqltocsv.go.txt
The text was updated successfully, but these errors were encountered: