Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change the format of a date?

Status
Not open for further replies.

majorbroncosfan

Programmer
Joined
Feb 23, 2001
Messages
121
Location
US
I have a datetime field that contains the value {9/1/2001}, but I need to get it into the format {2001/9/1}. How do I do this in FoxPro?
 
HI

Issue the command in the Main.Prg along with other set commands.. or in the InitEvent of the form

SET DATE YMD

This will set that :-) ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :-)
 
just call the set date ymd before the sql statement then reset the set date mdy when you are done

I usaly allow the user decide how the date looks

Using the set date function changes the way the information is displayed, not how it is stored.

hope this helps
 
Hi
You complete the SQL as you would do. Date fields are stored in DBF or CURSOR in a standard way. Only the display is changed according to the SET command when displaying the same. Hope this helps you :-)
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top