Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change a single character to a year?
Message
From
17/11/2002 22:19:16
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00723697
Message ID:
00723710
Views:
15
>
>Use the date() function. This is the best way to express a date value without having to worry about SET DATE settings.
>
>
>mDayOfService   = val( SUBSTR(ConvertThis.LineItem,53,2) )
>mMonthOfService = val( SUBSTR(ConvertThis.LineItem,56,2) )
>mYearOfService  = val( SUBSTR(ConvertThis.LineItem,59,1) )
>
>* Assuming the 1 digit year is from this century
>m.ServiceDate = date( 2000 + mYearOfService, mMonthOfService, mYearOfService )
>
Thank you Martin. The above works, but is based on the assumption that the 1 digit year is from this century.

Downside, it could be anywhere say for the last 30 years. Would the "Modified" column in Windows Explorer be useful in telling us of the exact year? If so, how doI capture that information?

Thank you again.
- Ravi

True greatness consists in being great in little things.
- Charles Simmons
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform