>>>I have a dbf table created from excel with date data in a char field(10) in a format of '2011-04-1"
>>>
>>>How would I convert this to regular foxpro data field format?
>>
>>
>>lcDate = '2011-04-1'
>>? ctod('^' + m.lcDate)
>>
Cetin
>
>That worked, but not sure how that trick works.
When a literal or date/datetime starts with ^ it specifies Year/Month/Day ordering and /-.space can be used as delimiters. It provides a date settings indepedant entry. VFP allows interesting literals to be accepted as a date/time. ie:
{^2007 1 31}
{^/1/31}
both mean Jan 31,2007 (assuming current year is 2007 for the latter). This is valid too:
{^2007/1/31 10p} - close to what humans like:)
lcDate = '2011-04-1'
'^' + m.lcDate
Cetin