PDA

View Full Version : change string data to date



Brett Desper
07-01-2010, 12:33 PM
First of all, thanks for all the amazing help I have received here.
I have a new problem that is giving me a bit of trouble solving.

I have a field that is being imported from a word document to export into xml.
I can get the contents of the field (which is a date in the mm/dd/yyyy format) but it comes in as a string. What I need to do is change the string to a date (with integers) in the mm/dd/yyyy format so that it will import properly into the next program (which requires all of these to be in this date form with integers instead of text).

Any help would be appreciated.


Thanks


Brett:dunno

Tinbendr
07-05-2010, 02:44 PM
While I know little about XML, I did find this on Microsoft's site. (http://office.microsoft.com/en-us/excel-help/import-xml-data-HP010206405.aspx)


Some data was imported as text Some or all of the data that you imported was converted from its declared data type to text. If you want to use this data in a calculation, you must convert the data from text to numbers or dates. For example, a date value converted to text will not work as intended in the YEAR function until you convert the date value to the Date data type. Excel converts data to text when:
The data is expressed in a format that Excel is unable to support.
The data is incompatible with the Excel internal representation of the XSD data type. To fix this problem, make sure that your XML data is valid according to the XML schema by checking each data type declaration.I understand what you mean now by date integers. But to try and fix this, we need a sample.

fumei
07-07-2010, 08:13 AM
And I am not sure you quite understand how dates work.

" (which is a date in the mm/dd/yyyy format) but it comes in as a string. "

There is no "but". mm/dd/yyyy IS a string.