Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wrong Years
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01333160
Message ID:
01333314
Views:
11
James,

You can post-process dates
TEXT TO lcStr NOSHOW
"Date","String","Int"
01/01/99,"String1", 15
12/25/98,"String2", 23
12/25/08,"String2", 31

ENDTEXT

STRTOFILE(lcStr, "temp.csv")

CREATE CURSOR Temp (fld1 D, fld2 C(30), Fld3 I)
APPEND FROM "temp.csv" CSV

lnCentury = SET("Century",1)
lnRollover = SET("Century",2)

UPDATE Temp ;
	SET fld1 = ICASE(YEAR(fld1) > 100, fld1, ;
		YEAR(fld1) >= lnRollover, GOMONTH(fld1,lnCentury*100*12), ;
		GOMONTH(fld1,(lnCentury+1)*100*12))


LOCATE
BROWSE NOWAIT
>
>Try running this...
>
>
>TEXT TO lcStr NOSHOW
>"Date","String","Int"
>01/01/99,"String1", 15
>12/25/98,"String2", 23
>
>ENDTEXT
>
>STRTOFILE(lcStr, "temp.csv")
>
>CREATE CURSOR Temp (fld1 D, fld2 C(30), Fld3 I)
>APPEND FROM "temp.csv" CSV
>LOCATE
>BROWSE NOWAIT
>
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform