>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)
>
I'll ask the obvious - have you tried CTOD(this.text)?
>
>?
>
>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
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.