CLOSE ALL USE C:\PRODUCTION\DATA\PRODUCTION IN 0 *** 04/09/2008 Cecil Champenois. We suddenly had a problem with the 2-Digit Year *** being missing in the Production.Date field. This is an effort to discover *** the problem and fix it. This problem started with the date of 04/08/08-0. *** This happened the following day with 04/09/08-0 turning into 04/09/-0. SELECT Production SET STEP ON * Capture the current year. LOCAL lcYear As Character, lcCurrentYear As Character lcYear=ALLTRIM(STR(YEAR(DATE()))) && Get the 4-Digit Current Year. lcCurrentYear=SUBSTR(lcYear,3,2) && Get the 2-Digit current year. * Let's see how many of these goofed up records we have. COUNT FOR SUBSTR(Production.Date,7,1)="-" && Example: "04/08/-0" * If we have 1 or more, let's fix them now. IF _TALLY > 0 SET FILTER TO SUBSTR(Production.Date,7,1)="-" BROWSE GO TOP SCAN FOR SUBSTR(Production.Date,7,1)="-" lcDashShift=SUBSTR(Production.Date,7,2) REPLACE Production.Date ; WITH LEFT(Production.Date,6) + lcCurrentYear + lcDashShift ; FOR SUBSTR(Production.Date,7,1)="-" SET STEP ON ENDSCAN ENDIF