Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I - DATETIME, CURRENCY field conversion
Message
De
13/01/1999 21:31:50
 
 
À
13/01/1999 21:16:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00175745
Message ID:
00175750
Vues:
31
>Help!
>
>I need to be able to display data from a DATETIME field as well as a CURRENCY field in a messagebox/ wait window and need to convert the data to a string.
>
>Is there any function to get the date and time as a string??

DTOC(DateTime), DMY(DateTime) or MDY(DateTime) can extract the date as a character expression in several formats, while TTOC(DateTime,2) will extract the time as a character expression. You can put them together to make what you need.

Currency data is best converted to strings using the TRANSFORM() function.

>
>eg the DATETIME field called Dtime1 has data 12/07/1999 14:23:44
>

With SET CENTURY ON, DTOC(Dtime1) + ' ' + TTOC(Dtime1,2) does what you want.
>I need to display this the same way and need as a result a string as above "12/07/1999 14:23:44"
>
>How do I do this without extensive manipulation of hours(), minutes() etc??
>
>
>Bernard
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform