Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/171286

From BetaArchive Wiki

WD: Find File Fails with Dates Beyond Year 2000

Q171286



The information in this article applies to:


  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c





SYMPTOMS

When you try to perform a search for a document in Microsoft Word 2.x or 6.x for Windows using the Find File feature, the search fails if you search for dates later than December 31, 2000.



CAUSE

By default, Word 2.x and 6.x only use the last two digits of the year when using the Find File feature; therefore, when you enter a year of 2006, Word searches for the year 1906 rather than 2006.

NOTE: This is only a limitation of the default date format that is used in the Find File feature. Internally, Word 2.x and 6.x use a four-digit representation of the year. Note also that the file searching feature of Microsoft Word for Windows 95, version 7.x, and Word 97 use all four digits of the year.



WORKAROUND

To work around this problem, you can use one of the following methods.

Method 1: Modify the Default Date Format Used by the Find File Feature

Word 6.x

You can force the Find File feature to use all four digits of the year by changing the default date format that Microsoft Word uses. This is done by changing a setting in the Winword6.ini file. To do this, follow these steps:


  1. Start Microsoft Word.
  2. On the File menu, click Open.
  3. Open the Winword6.ini file.
    By default, this file is located in the Windows directory.
  4. Add the following setting to the [Microsoft Word] section of the Winword6.ini file:

    DATEFORMAT=<format>

    where <format> is the default format you want Word to use when you insert a DATE field. It is also the date format the Find File feature uses.

    NOTE: To prevent certain types of inconsistent behavior with respect to dates, the date format string you add to the Winword6.ini file should correspond to the date format that is set in the Regional or International Settings in Windows Control Panel.

    The following are example formats that use the four-digit year format:

       Setting                               Result
       ------------------------------------------------------------
    
       DATEFORMAT=MM/dd/yyyy                 01/02/1994
    
       DATEFORMAT=MMMM d, yyyy               January 2, 1994
    
       DATEFORMAT=MMMM dd, yyyy              January 02, 1994
    
       DATEFORMAT=dddd, MMMM d, yyyy         Sunday, January 2, 1994 

You can use any Date-Time Picture switch format for this setting. To display all the available Date-Time Picture switch formats, double-click the Help button on the Standard toolbar, and then type "Date-Time Picture" (without the quotation marks).

NOTE: If you set the DATEFORMAT key in your Winword6.ini file to be a four-digit date, the Advanced Find file will accept four-digit years.

Word 2.x

You can force the Find File feature to use all four digits of the year by changing the default date format that Microsoft Word uses. This is done by changing a setting in the Win.ini file. To do this, follow these steps:


  1. Start Microsoft Word.
  2. On the Tools menu, click Options.
  3. Under Category, select the Win.ini icon.
  4. Under the Application drop-down menu, select Microsoft Word 2.0.
  5. In the Option text box, type DATEFORMAT.
  6. In the Setting text box, type the date format you want Word to use when you insert a DATE field. This is also the date format used by the Find File feature.


NOTE: To prevent certain types of inconsistent behavior with respect to dates, the date format string you add to the Win.ini file should correspond to the date format that is set in the Regional or International settings in Windows Control Panel.


The following are example formats that use the four-digit year format:


   Setting                               Result
   ------------------------------------------------------------

   DATEFORMAT=MM/dd/yyyy                 01/02/1994

   DATEFORMAT=MMMM d, yyyy               January 2, 1994

   DATEFORMAT=MMMM dd, yyyy              January 02, 1994

   DATEFORMAT=dddd, MMMM d, yyyy         Sunday, January 2, 1994  

You can use any Date-Time Picture switch format for this setting. To display all the available Date-Time Picture switch formats, follow these steps:

  1. On the Help menu, click Help Index.
  2. Click Search.
  3. Type Date-Time Picture switch.
  4. Click Show Topics.
  5. Click Go To.

Method 2: Use the Microsoft Windows Operating System File Search Feature

To find a file in Microsoft Windows 95 or Microsoft Windows 98, follow these steps:

  1. Click the Start button, point to Find, and click Files or Folders.
  2. Click the Date Modified tab.
  3. Enter a search date in a format similar to 1/1/2006.

To find a file in Microsoft Windows 2000, follow these steps:

  1. Click Start, point to Search and then click For Files or Folders.
  2. If you want to specify the location to start the search, click a folder in the Look in list.
  3. Select the Date check box.
  4. Enter a search date in a format similar to 1/1/2006.



MORE INFORMATION

The DATEFORMAT setting in the Winword6.ini or the Win.ini file influences several different areas of Word. Each of the following areas correctly represents the year using a four-digit format if DATEFORMAT is set accordingly.

File Date:

By default, in Word, the file date uses the date format order set specified in the Windows Regional Settings (Control Panel). This date format is MM/dd/yy for the United States, dd/MM/yy for Europe, and yy/MM/dd for Japan. Therefore, a date of January 1, 2006, is represented the same way as January 1, 1906. That is, both dates are represented in the form "1/1/06."

Saved or Creation Date:

Unless you have changed the default year format in the Winword6.ini or the Win.ini file, the Find File feature uses only the last two digits of the Saved Date or the Creation Date when performing a search. The valid date range for Find File is 01/01/1901 (01/01/01) to 12/31/2000 (12/31/00).

Summary Information:

By default, the Summary Information that is displayed when you click the File menu, click Summary Info, and click Statistics, displays only a two-digit representation of the year.

Related Date Fields:

Date-related fields, such as CreateDate, Date, PrintDate, SaveDate, and Time, correctly display a four-digit year if you choose a four-digit date format option such as "MMMM d, yyyy" (four y characters signify a four-digit year, while two y characters signify a two-digit year).

In WordBasic, date-related commands have the following range of recognized dates.

   Command        Limitation
   -----------------------------------------------------------------------

   Date$()        Valid for 12/30/1899 to 12/31/4095. This command will
                  return a date with a two-digit year if it is formatted
                  to do so. Otherwise it will return a four-digit year.

   DateSerial()   Valid for 12/30/1899 to 12/31/4095. To specify dates
                  after the year 1999, you must use all four digits of the
                  year.

   DateValue()    Valid for 12/30/1899 to 12/31/4095. To specify dates
                  after the year 1999, you must use all four digits of the
                  year.

   Day()          Valid for 12/30/1899 to 12/31/4095.

   Days360        Valid for 12/30/1899 to 12/31/4095. 



REFERENCES

For more information, please see the following articles in the Microsoft Knowledge Base:


Q110995 WD6X: How to Set a Default DATE Field Format in Word 6.0



Q85557 File Manager Shows Garbled Date for Year 2000 or Later


For more information about how Microsoft products are affected by year 2000 (Y2K) issues, please see the following Microsoft World Wide Web site:

http://www.microsoft.com/technet/year2k/product/product.asp



Additional query words: year 2000 y2k

Keywords : kbinterop kbdta kbYear2000
Issue type : kbprb
Technology : kbWordSearch kbZNotKeyword2 kbWord600 kbWord600a kbWord600c


Last Reviewed: November 5, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.