Date incorrect as Text
-
vendredi 6 juillet 2012 02:37
Excel 2007
Hi All,
I have created a package in SSIS which uses a SQL statement and one of the columns invoiceDate comes out as DD-MON-YY as date data type. I then export this column with others into excel. The process works fine but when the invoiceDate column is inserted into excel changes it to text. So the application also sees it as text and not a date.
Does anyone know of a way to have 02-Jun-12 in excel as a date column? and not as text with the little green mark in the top left of the field.
I have tried changing the column to the date format before the data is inserted but this doesn't work.
Thanks
Toutes les réponses
-
vendredi 6 juillet 2012 05:58Auteur de réponse
Check carefully if any other charecter is embedded along with the data.Like ' as prefix char.It may force excel to treat as text.
---------------------------------------------------------------------------------------------
Please do not forget to click “Vote as Helpful” if any post helps you and Mark as Answer if it solves the issue.
- Modifié Learning and LearningEditor vendredi 6 juillet 2012 05:58
-
vendredi 6 juillet 2012 17:12
Hello:
If it imports it as text, it is a simple matter to convert it to a date. Here's a copy and past from the VBE Immediate Screen:
? CDate("02-Jun-12")
6/2/2012
As you can see, the CDate function figures it out.
Regards,
Rich Locus, Logicwurks, LLC
- Proposé comme réponse Leo_GaoModerator mardi 10 juillet 2012 06:34
- Marqué comme réponse Leo_GaoModerator jeudi 12 juillet 2012 01:32

