Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET CENTURY stuff
Message
 
To
08/04/1999 13:34:40
Bob Lucas
The WordWare Agency
Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00206098
Message ID:
00206623
Views:
21
I tried

lccentury = int(YEAR(this.value)/100)
SET CENTURY TO lccentury

and it didn't work. If you have are fiddling around and get something like this (or anything else) to work with 2 digits, please let me know. Thanks for the suggestion.


Regarding
"So I agree with your point. If your users want two digit years, they should have them. As you imply, you know how to deal correctly with this data."

Thanks. I hate making arguments (such as "the system should show 4-digit years") when the real reason for the argument is "That's what I'm forced to do."

Take care,
Joe

>This may be overkill, but I wonder what affect it would have to change the set century setting before entering the textboxes (in the gotfocus)
>
>for instance
>
>lccentury = YEAR(this.value)
>SET CENTURY TO lccentury
>
>
>This might help keep the year at two digits.
>
>I did an evaluation of a FPW 2.6 application for Y2K compliance, and though it only ever used two digit days, I could not get it to produce wrong results. If I entered a year like 05/12/31 it displayed in the debug window with a year of 1905 when I meant 2005 but after the data was save and retrieved, it came back as 2005!
>
>The reason was that SQL was the data store and when you try to store an ambiguous date it used its built in rollover to properly assign the century. It may be that the app had some Y2K issues, but in spite of all the dates I messed with (even on date range forms when selecting report data, etc.) It always worked as expected.
>
>the only time it started to mess up was when century was set on.
>Disappointing.
>
>So I agree with your point. If your users want two digit years, they should have them. As you imply, you know how to deal correctly with this data.
>
>
>>>>
>>>>If you show 4 digits, you have to enter 4 digits when you enter dates in the YMD format.
>>>>
>>>>Joe
>>>
>>>
>>>
>>>Not true! You CAN enter only 2 digits, no matter what the format is.
>>
>>Then why when I tab to a field that is showing 2001/01/02, and I enter the keystrokes 990501 does it not work? It tries to put the date 9905/01... into the field.
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Previous
Reply
Map
View

Click here to load this message in the networking platform