Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not my date type
Message
De
29/03/2014 11:52:53
Bill Fitzgerald (En ligne)
Woodbury Systems Group
Hamilton, New Jersey, États-Unis
 
 
À
29/03/2014 11:31:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01597645
Message ID:
01597648
Vues:
57
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform