General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows 2008 Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only