Re: Previous Year in a Date Field

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Jamie wrote:
> I'm using Word 2002.
>
> I have a date field, the date format is MMMM yyyy. If I enter 10/04
> the field shows October 2005, it doesn't accept any previous year. I
> need the user to be able to enter information from any month of a
> previous year to any current month year. How can I get the field to
> accept the previous year(s)?
>
> Thanks for your help.

Word is guessing about how to interpret what you typed, and it's guessing
wrong. You'll have to supply the "smarts" yourself...

When you enter 10/04 in the field, Word assumes that these are the month and
the *day* (or vice versa, depending on your Regional date settings in
Windows), and goes on from there to assume that you omitted the year so you
must have meant this year. Hence the result October 2005.

If the second part of the date clearly can't be a day number -- for example,
10/95 -- then the field guesses that it must be the last two digits of a
year beginning with '19'. It isn't programmed to assume a year beginning
with '20' at all.

You can either enter all three parts of the date (choosing any day, as that
will be discarded) as 10/1/04 or you can enter the year as all four digits,
10/2004. Either of those entries will display a result of October 2004. I
can't think of any way to force the field to recognize your entry the way
you intended in all circumstances.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


.



Relevant Pages

  • Re: Custom date format not working in ACC2003
    ... It forces the year to display as 4 digits in dates, ... setting the Format of the control won't rescue it. ... the date fields in reports always format ...
    (microsoft.public.access.reports)
  • Re: Price Data Formatting
    ... I'm loading into the application price data that has a format I do not know ... Since price data format is all dependent on the market selected (say IBM ... rounded/truncated to 2 digits following the decimal as well. ... Dim sStr As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Format Problem
    ... I set the numberformat property to General and it still does ... for the long date format. ... for the month and date separator, and displays two digits for the year. ... Currency Displays a number according to the Windows regional ...
    (microsoft.public.excel.programming)
  • Re: real, kind difference between gfortran an ifort
    ... IEEE double format that can be represented exactly. ... Noise is the term that physicists and engineers would usually use. ... (their significance is less than the last bit of the floating point ... have gotten all of the digits printed correctly if a longer format had ...
    (comp.lang.fortran)
  • Re: Text formatted cells displaying numbers in scientific format
    ... It is just Excel trying to be helpful. ... When it 'sees' a large number it uses scientific format since ... I accept that Excel can't handle numbers greater than 15 digits and your ... string was 16 digits or more to be converted to a scientific value. ...
    (microsoft.public.excel)