Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need YYYYDDD to DATE() function. Anyone?
Message
 
To
25/01/2001 12:38:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00468591
Message ID:
00469031
Views:
16
Hi Alex

Here is my Period (yyyymmdd) to date function.

Simon White
LParameter lcPeriod
Local ldDate
Do Case
Case Empty(lcPeriod).Or.PCount()=0
   ldDate=TTOD({--,:})
Case Len(lcPeriod)=4
   ldDate=TToD(DateTime(Val(Left(lcPeriod,4)),1,1))
Case Len(lcPeriod)=6
   ldDate=TToD(DateTime(Val(Left(lcPeriod,4)),Val(SubStr(lcPeriod,5,2)),1))
Otherwise
   ldDate=TToD(DateTime(Val(Left(lcPeriod,4)),Val(SubStr(lcPeriod,5,2)),Val(Right(lcPeriod,2))))
EndCase   
Return ldDate
Simon White
dCipher Computing
Previous
Reply
Map
View

Click here to load this message in the networking platform