How can we help you today? How can we help you today?

Exporting SQL Query results to Excel (Dates)

Hi there,
I am new here so please forgive me if I am posting in the wrong place.

I have a SQL query that returns some dates depending on a number in another column. If the number is zero then I want it to return 1900-01-01, which we use in our systems as a NULL date.

The query returns the date as 1900-01-01, but if I highlight the results grid and Open in Excel these dates appear in the spreadsheet as a STRING.

The SQL I am using is as follow:-

CONVERT(DATE, CASE
  WHEN ISNULL(m.mrpldays, 0) = 0 THEN 0
  ELSE m.mrpltdate
END) AS [Reschedule Date],

Can anyone throw any light on it?

IanP
0

Comments

4 comments

  • ATurner
    Hi IanP,

    Seem to be getting the same issue here just going to speak to the development team on this one.
    ATurner
    0
  • IanP
    ATurner said:
    Hi IanP,

    Seem to be getting the same issue here just going to speak to the development team on this one.
    Did you ever get a response? As I'm still getting the problem.
    IanP
    0
  • ATurner
    Hi IanP

    It is still on the teams list.
    ATurner
    0
  • ATurner
    Hi IanP this should be fixed in the latest release.
    ATurner
    0

Add comment

Please sign in to leave a comment.