Inputting a date as Month - Year?

  • Thread starter Thread starter Simon Webb
  • Start date Start date
S

Simon Webb

Is there any way a date field can be formatted so that the operator only has
to enter month / year? (with preferably the day defaulting to the first day
of the month)?

I want to do in in such a way that the date format will be based on the PC
settings.

thanks in advance

Simon Webb
 
No, but you could store the month and year in two fields, and then use an
expression to display the information on a form or report...no need to store
a day if it's always going to be the first day.

To display the date for the first day of a month/year combination:

DateSerial([YearField], [MonthField], 1)
 
What problem would you forsee if the user entered a month/2-digit year?
Wouldn't this be interpreted, as requested by the OP, according to the PC's
settings?
 
No, not per my testing. If for example, you enter
4/02

the value stored in the table is actually April 2, 2005 (for my US system).

If you enter 3/98, the value stored is March 1, 1998; I assume the
difference is because ACCESS knows that no month has 98 days.

The confusion appears to result if the "second" number is 31 or less,
obviously depending upon the month number for the "first" number

--

Ken Snell
<MS ACCESS MVP>
 
Back
Top