I'm working on an Excel add in, retrieving data from a SQL Server database and inserting it into Excel.
In the database I have a date 2013-06-01 (YYYY-MM-DD)
When reading from the database using SqlDataReader, the following command:
myReader.GetValue(c)
Returns 06/01/2013 (DD-MM-YYYY), when is then stored in Excel taking 6 as the day and 1 as the month number
Any ideas what could be going on?
Thanks
DATEorDATETIME, and then you should be able to properly read it usingmyReader.GetDateTime(c)