New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV DateTime Export #345

Closed
msopko81 opened this Issue Sep 19, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@msopko81

msopko81 commented Sep 19, 2017

When doing a CSV export, datetime columns do not export properly. Run this query:

SELECT CAST('2017-09-18' AS DateTime) AS FIRST,
       CAST('2017-09-18' AS DateTime) AS SECOND,
       CAST('2017-09-18' AS DateTime) AS LAST

CSV gets exported like:

FIRST,SECOND,LAST
1505692800000,1505692800000,2017-09-18T00:00:00.000Z

DateTime fields will only be exported properly if it is the last column. JSON works as expected:

[
  {
    "FIRST": "2017-09-18T00:00:00.000Z",
    "SECOND": "2017-09-18T00:00:00.000Z",
    "LAST": "2017-09-18T00:00:00.000Z"
  }
]

Version: 1.20.2
DB: MSSQL

@maxcnunes

This comment has been minimized.

Show comment
Hide comment
@maxcnunes

maxcnunes Oct 14, 2017

Member

@msopko81 Does it still happening for you? I get this in the latest version:

FIRST,SECOND,LAST
2017-09-18 00:00:00,2017-09-18 00:00:00,2017-09-18 00:00:00
Member

maxcnunes commented Oct 14, 2017

@msopko81 Does it still happening for you? I get this in the latest version:

FIRST,SECOND,LAST
2017-09-18 00:00:00,2017-09-18 00:00:00,2017-09-18 00:00:00

@krolow krolow removed their assignment Oct 15, 2017

@msopko81

This comment has been minimized.

Show comment
Hide comment
@msopko81

msopko81 Oct 17, 2017

I just upgraded to version 1.26.0 and am still having the same error. Not sure if this helps, but I am also running an older SQL Server version:

SELECT @@Version;

Microsoft SQL Server 2014 (SP1-GDR) (KB4019091) - 12.0.4237.0 (X64) Jul 5 2017 22:03:42 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.3 (Build 9600: ) (Hypervisor)

I also tried this on SQLite and PostgreSQL databases and I do not get this issue.

msopko81 commented Oct 17, 2017

I just upgraded to version 1.26.0 and am still having the same error. Not sure if this helps, but I am also running an older SQL Server version:

SELECT @@Version;

Microsoft SQL Server 2014 (SP1-GDR) (KB4019091) - 12.0.4237.0 (X64) Jul 5 2017 22:03:42 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.3 (Build 9600: ) (Hypervisor)

I also tried this on SQLite and PostgreSQL databases and I do not get this issue.

@maxcnunes

This comment has been minimized.

Show comment
Hide comment
@maxcnunes

maxcnunes Oct 17, 2017

Member

Hmm, I didn't notice you were using MSSQL. I have tested with PostgreSQL only. Sorry, I don't have an MSSQL to test it out.

Member

maxcnunes commented Oct 17, 2017

Hmm, I didn't notice you were using MSSQL. I have tested with PostgreSQL only. Sorry, I don't have an MSSQL to test it out.

@tengis

This comment has been minimized.

Show comment
Hide comment
@tengis

tengis Oct 20, 2017

i'm using MSSQL and also i tested on master branch. Looks like all looking fine on mine.

FIRST,SECOND,LAST 2017-09-18T00:00:00.000Z,2017-09-18T00:00:00.000Z,2017-09-18T00:00:00.000Z

[ { "FIRST": "2017-09-18T00:00:00.000Z", "SECOND": "2017-09-18T00:00:00.000Z", "LAST": "2017-09-18T00:00:00.000Z" } ]

tengis commented Oct 20, 2017

i'm using MSSQL and also i tested on master branch. Looks like all looking fine on mine.

FIRST,SECOND,LAST 2017-09-18T00:00:00.000Z,2017-09-18T00:00:00.000Z,2017-09-18T00:00:00.000Z

[ { "FIRST": "2017-09-18T00:00:00.000Z", "SECOND": "2017-09-18T00:00:00.000Z", "LAST": "2017-09-18T00:00:00.000Z" } ]

@msopko81

This comment has been minimized.

Show comment
Hide comment
@msopko81

msopko81 Oct 26, 2017

I tested with the latest release and this issue has been resolved.

Thank you,

msopko81 commented Oct 26, 2017

I tested with the latest release and this issue has been resolved.

Thank you,

@msopko81 msopko81 closed this Oct 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment