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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple question on changing year to 4 char.

Status
Not open for further replies.

Howard2002

Programmer
Aug 2, 2002
12
US
what is the syntax for changing a year field from two char to four char. i have the field defined as 4 char. but the data is 2 char. there is no 2000+ years
 
set century on and year(date()) I guess, but your question is a little confusing

How did the data get in there in the first place?

Was this a table and application pre-Y2k nightmare?


Darrell
'We all must do the hard bits so when we get bit we know where to bite' :)
 
Howard2002

Darrell has given the solution SET CENTURY ON should do it. Don't forget if you use private datasessions in your form, you will have to reset it in the load of the form.
BTW as far back as FPW2.6, FoxPro has always stored the full 4 digits (I cannot speak for versions prior). Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
since the days of dBase II, the complete 4 digit year was stored. with the set century on, you may want to view the help file on ROLLOVER. Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top