Works: Converting a Five- or Six-Digit Number to a Date (112429)



The information in this article applies to:

  • Microsoft Works 2.0
  • Microsoft Works 3.0
  • Microsoft Works 4.5
  • Microsoft Works 4.5a
  • Microsoft Works for Windows 95, version 4.0
  • Microsoft Works for Windows 95, version 4.0 4.0a

This article was previously published under Q112429

SUMMARY

Some database applications may require you to enter date values as a 5- or 6-digit number (that is, 5/15/92 is entered as 051592). To convert this value to a date in Works, enter the following formula in a separate field

=DATE(MOD(ref,100),INT(ref/10000),MOD(INT(ref/100),100))

where "ref" is replaced with a field name in the database or a cell reference in the spreadsheet.

This equation places the decimal equivalent of the date in the destination field. Note that if the day or year number has a single digit, as in 5/5/92, the original date value would have to include a zero, as in 050592.

To change the field to a date format in Works 3.0, 4.0, 4.5 and 4.5a:

  1. From the Format menu, click Number.
  2. Select Date from the Format box.
  3. Select the desired date format in the Date box and click OK or press ENTER.
To change the field to a date format in Works 2.0:

  1. From the Format menu, click Time/Date.
  2. Select the desired date format in the Show and Date boxes and click OK or press ENTER.

Modification Type:MajorLast Reviewed:11/15/2004
Keywords:kbinfo KB112429