finos / kdb-studio

Studio for kdb+ / Rapid execution environment for q
Apache License 2.0
18 stars 12 forks source link

Cannot copy dates to Excel. #143

Open audetto opened 1 year ago

audetto commented 1 year ago

Bug Report

Steps to Reproduce:

  1. Run a query that returns a date in a table.
  2. Copy
  3. Paste in Excel
  4. Value is "2023.01.23"
  5. Excel does not recognise it as a date

Expected Result:

Date automatically handled in Excel.

Actual Result:

Excel sees a string not a date. Even =DATEVALAUE() cannot handle the string format.

Environment:

Windows 11, Excel 365

Additional Context:

Excel represents dates as number of days since 1900 something. Ideally kdb-studio should use this format.

Using a string still requires DATEVALUE(), in which case kdb-studio should select a better format (see https://support.microsoft.com/en-us/office/datevalue-function-df8b07d4-7761-4a93-bc33-b7471bbff252) but it might become locale-dependent. The number is safer.

"Open in Excel" works, but it has the bad habit of opening a new Excel session, from which one can copy, true, but still very cumbersome.