>>Hi Chaps
>>
>>I've written a prog to work in FPD, to read in an XLS/CSV file and create a table (from a given copy struct).
>>
>>For ease of use I've been testing it in VFP and everything's hunky-dory. BUT the resultant table is not knowable from FPD26. So I've rebuilt the FPD proj and created a new EXE for it.
>>
>>When I run this, a date field that yields, say, 11/04/2006 in VFP, ends up with XX/XX/1920.
>>
>>I've got century on, date british
>>
>>
>>Select IntermTable
>>Locate
>>Skip
>>Scan Rest
>> Scatter MEMVAR
>> Select DestFB1
>> Append Blank
>> Replace Operator with tnOperator, ;
>> Journey with VAL( m.B), ;
>> Route with PADL( ALLTRIM( m.C), 4, "0"), ;
>> Date with CTOD( m.E), ;
>> Class with PADL( ALLTRIM( m.D), 4, "0"), ;
>> TickTime with ALLTRIM( m.F), ;
>> Number with VAL( m.G), ;
>> Fare with VAL( m.H), ;
>> Value with VAL( m.I), ;
>> OStage with PADL( ALLTRIM( m.J), 4, "0"), ;
>> DStage with PADL( ALLTRIM( m.K), 4, "0"), ;
>> Driver with VAL( m.L), ;
>> Bus with VAL( m.M), ;
>> Duty with VAL( m.N)
>>EndScan
>>
>>
>>
>>IntermTable is that into which the XLS is initially imported.
>>
>>The s/s/ date is in the form: XX-XX-2006
>>I've just realised that I haven't Set Mark to "-" - would that make any difference?
>>
>>Obviously, somewhere the s/w is treating the date as short (as with Cent off) but I can't figure out how/why.
>>
>>Any ideas?
>>
>>'ppreciate it
>>
>>Terry
Hi Cetin
>
>Terry,
>I can't explain why VFP would return correct date vs FPD. You're doing a replace ( ctod(m.e) ). That makes me suspect field e width is 8 and not 10 which
That would have explained it to me immediately too. No, intercepting the imported, intermediate table, INTERMTABLE
? CTOD(ALLTRIM(E)) yields 11-06-2006
? ALLTRIM(E) yields 11-06-2006
Browsing shows all dates in their glory. I mean, I
did check all this.
>would explain it returning as 1920. Hard case:) FPD just works right for me.
>PS: "-" wouldn't make a difference. And why don't you get it as date into intermtable in the first place?
I wasn't aware that the command:
Import From &tcXLSFilePath Type XLS && produces DBF copy of XLS file, with same name
had the ability to specify that the XLS date-looking field convert into a FP date field in the resultant table. How to do this?
Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.