Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Difference in Date Save between VPP 7 & FPD
Message
From
27/09/2006 07:39:10
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01157275
Message ID:
01157447
Views:
19
>>>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				&& 26/09/06 just to skip XLS/CSV header, col headings rec
>>>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 teh 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

Well do not be so sure. You are IMHO lucky you even have something you can see:)
Check structure of intermTable. XLS imports are funky in themselves. First row conquers the datatype and that's why months ago (actually years I think) I demonstrated why import and csv appends were not safe if they contained date data.

Actually you're lucky to have an IMPORT that returns anything from date fields in Excel.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform