Sunday, 3 May 2015

Date Imported From Excel Changed Into Number


When importing data from an Excel file into VFP cursor, a date field may change into number field like the example below:


 Date in Excel
Current Number In Cursor
19-Dec-2006
39070
30-dec-2008
39812
19-May-1989
32647

To fix the issue, we could either replace all the serial numbers in the new field with this command:

Scan
   Replace SomeField with SomeField + {^1899/12/30}
EndScan

Or use a select statement that should convert that serial number back to date readable by human eyes.
Select SomeField + {^1899/12/30} As NewField from SomeTable Into Cursor TestCursor

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...