Marc,

If your data entry is predominately dates in the past, such as birthdates, then 
a low 
YEAR setting, but one that is above the current year, makes sense. If your data 
entry 
is predominately dates in the future, then a number slightly below the current 
year 
number makes sense. If it's about have and half, then a number about 50 years 
above the current year number might make the most sense.

As for making the year float, your application can check the current year, and 
then 
after connecting to the database, can issue its own SET DATE commands. For 
example, say you wanted the YEAR number to stay two years above the current 
year, so that on January 1, 2005, "08" data entry for the  year would be 
assumed to 
be 1908, but 07 would be assumed to be 2007. 

You could put code like this at the top of your application (after the CONNECT 
command, because DATE settings are saved with the database, and when you 
CONNECT, the saved settings overwrite what you had previously):

SET VAR vYearsToIncrement INT = 2
SET VAR vThisYear INT = (IYR(.#DATE))
SET VAR vThisYear = (MOD(.vThisYear,100)) -- trim the century
SET VAR vSequenceValue INT = (.vThisYear + .vYearsToIncrement)

SET DATE FORMAT 'MM/DD/YYYY'
SET DATE SEQUENCE MMDDYY
SET DATE YEAR .vSequenceValue
SET DATE CENTURY 19

And of course, if your application is still likely to be in use in 90 years or 
so, you need 
to use similar tricks for the CENTURY setting.

Bill

On 17 Dec 2004 at 9:19, Marc wrote:

> I have been using the code below for dates but somewhere
> I remember seeing some code that allowed the year to float.
> 
> Does anyone remember that or have a better suggestion?
> 
>  SET DATE FORMAT 'mm/dd/yyyy'
>   SET DATE SEQUENCE mmddyy
>   SET DATE YEAR 5
>   SET DATE CENTURY 19
> 
> Thanks
> Marc
> 

Reply via email to