Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not my date type
Message
From
29/03/2014 11:31:07
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Not my date type
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01597645
Message ID:
01597645
Views:
82
Hi All,

Is there a better, or shall I say more elegant, way of extracting the numeric values from a date-formatted ("03/27/2014") text string than the following:

lnmon=val(left(alltrim(this.text),2))
lnyear=val(right(alltrim(this.text),4))
lnday=val(substr(alltrim(this.text),4,2))
lddate=date(lnyear,lnmon,lnday)


?

It relates to dbi-tech's ctdropdate.ocx calendar datepicker. It converts date() to its own numeric value, say 41567 (no. of days since 01/01/1900), but returns the date in a text string. There's doesn't appear to be an easy way to make it revert to a date vartype(), other than these sorts of coding gymnastics. It works fine, just looks brutal. Any ideas?
Thanks.

Luke
Next
Reply
Map
View

Click here to load this message in the networking platform