Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stuff a date into a datetime
Message
De
03/03/2006 17:48:12
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01100895
Message ID:
01101429
Vues:
13
>Have a Date datatype in a grid - date1. On the database the field is a datetime - datetime1. If the client enters a new Date in the grid, want to stuff that date into the datetime field. The client can enter a past or current date.
>
>if ttod(datetime1) != date1
> datetime1 = datetime()
>** now want to make the date portion of datetime1 = date1
>endif
>
>thanks
>
>Brenda
m.tDt = DATETIME()
m.dDO = m.dSomeDate                 && or whatever date/date variable you need
m.nSecs = m.tDt-DTOT(TTOD(m.tDt))   && Get the seconds from the original DateTime value
m.tNew = DTOT(m.dDO) + m.nSecs      && Add the seconds to the Date value that's converted to a DateTime value
?m.tNew
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform