Dates not recognized as dates in pivot table pulling directly from SQL Server

Posted by Michael K on Super User See other posts from Super User or by Michael K
Published on 2011-02-03T16:52:07Z Indexed on 2012/11/15 17:06 UTC
Read the original article Hit count: 232

My pivot pulls from an external data source with a date column. Excel doesn't see this column as a date and the 'Format Cells' option panel doesn't change how the dates are displayed. The cell data is left-aligned, suggesting a string rather than a date. I have tried cast(myvar as date) and convert(varchar, myvar, 101) and convert(varchar, myvar, 1) in the base table, but none of these have been picked up by Excel as dates.

If the column is recognized as a date, I can group by week and month. I understand that if I can't fix this, the next step is to add columns with weeks and months for each date to the table, but I'd like to give formatting the column one more shot before doing that.

© Super User or respective owner

Related posts about microsoft-excel

Related posts about sql-server