Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stuff a date into a datetime
Message
 
 
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:
01100918
Vues:
11
This message has been marked as the solution to the initial question of the thread.
>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

One of the ways:
local lnHours, lnMinutes, lnSeconds

lnHours = hour(datetime1)
lnMinutes = minute(datetime1)
lnSeconds = sec(datetime1)

replace datetime with ;
datetime(year(date1), month(date1), day(date1), m.lnHours, m.lnMinutes, m.lnSeconds)
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform