By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

can a date accept only a year

P: n/a
We are entering mm/dd/yyyy but some of the date fields only contain
years. Can a date be made to only take a year entry if that is all
that they have?
can it be made to take only 2008 or maybe even 00/00/2008

Sep 15 '08 #1
Share this Question
Share on Google+
10 Replies


P: n/a
A date field requires a date data type and a valid one at that. Neither 2008
or 00/00/2008 are acceptable. If the year is good enough for your records (a
365 day range) surely any month and day is as good as another. Pick one.

Chris
Microsoft MVP
sparks wrote:
>We are entering mm/dd/yyyy but some of the date fields only contain
years. Can a date be made to only take a year entry if that is all
that they have?
can it be made to take only 2008 or maybe even 00/00/2008
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Sep 15 '08 #2

P: n/a
On Mon, 15 Sep 2008 12:44:52 GMT, "Chris O'C via AccessMonster.com"
<u29189@uwewrote:
>A date field requires a date data type and a valid one at that. Neither 2008
or 00/00/2008 are acceptable. If the year is good enough for your records (a
365 day range) surely any month and day is as good as another. Pick one.

Chris
Microsoft MVP
sparks wrote:
>>We are entering mm/dd/yyyy but some of the date fields only contain
years. Can a date be made to only take a year entry if that is all
that they have?
can it be made to take only 2008 or maybe even 00/00/2008

I told them to put in 01/01/YYYY for data with only a year.
So that sould work out ok. They agreed and are doing it that way from
now on.

They ask a date but just like everything else. No one can remember a
certain date but they remember the year and sometimes the month.
I suggested a day month and year fields. 3 fields to store the date.
This would mean 19 fields becomes 57. and so on. More error on entry
as well.
Sep 15 '08 #3

P: n/a
Don't make it more error prone. Keep them as a date fields.

Chris
Microsoft MVP
sparks wrote:
>I suggested a day month and year fields. 3 fields to store the date.
This would mean 19 fields becomes 57. and so on. More error on entry
as well.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Sep 15 '08 #4

P: n/a
Why not use a unbound text field in your form, set the input mask to
0000;;_.
Use the after update event to append "1/1" to the entered year and update
the field.

"Chris O'C via AccessMonster.com" <u29189@uwewrote in message
news:8a3be40740bb2@uwe...
Don't make it more error prone. Keep them as a date fields.

Chris
Microsoft MVP
sparks wrote:
I suggested a day month and year fields. 3 fields to store the date.
This would mean 19 fields becomes 57. and so on. More error on entry
as well.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Sep 15 '08 #5

P: n/a
Most of the time it's a full date that needs to be entered, your input mask
would prevent that. Two text boxes would be needed, one for date and one for
year if that's all the user has available, with added code and more
opportunities for confusion and errors. Better to keep it simple.

Chris
Microsoft MVP
paii, Ron wrote:
>Why not use a unbound text field in your form, set the input mask to
0000;;_.
Use the after update event to append "1/1" to the entered year and update
the field.
>Don't make it more error prone. Keep them as a date fields.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Sep 15 '08 #6

P: n/a
The OP states that some fields take mm/dd/yyyy and others need only the
year. I don't think you would want to mix input formats in the same field.

"Chris O'C via AccessMonster.com" <u29189@uwewrote in message
news:8a3e063e40ad1@uwe...
Most of the time it's a full date that needs to be entered, your input
mask
would prevent that. Two text boxes would be needed, one for date and one
for
year if that's all the user has available, with added code and more
opportunities for confusion and errors. Better to keep it simple.

Chris
Microsoft MVP
paii, Ron wrote:
Why not use a unbound text field in your form, set the input mask to
0000;;_.
Use the after update event to append "1/1" to the entered year and update
the field.
Don't make it more error prone. Keep them as a date fields.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Sep 15 '08 #7

P: n/a
Sparks has 19 date fields and suggested breaking that up into 3 number fields
to accommodate the occasional data input where only the year is available.

Keep all 19 fields as date data types, keep it simple. Adding Jan. 1st when
only the year is known is a good default because it's a holiday when most
aren't working. So it's a visual cue that only the year is right.

Chris
Microsoft MVP
paii, Ron wrote:
>The OP states that some fields take mm/dd/yyyy and others need only the
year. I don't think you would want to mix input formats in the same field.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Sep 15 '08 #8

P: n/a
I agree with you to not break a date into 3 number fields. But why force the
users to enter a default day and month on the fields requiring only year?
The form can easily accept year input, append the default day and month,
then store it in a date field.

"Chris O'C via AccessMonster.com" <u29189@uwewrote in message
news:8a3e3ddac39f2@uwe...
Sparks has 19 date fields and suggested breaking that up into 3 number
fields
to accommodate the occasional data input where only the year is available.

Keep all 19 fields as date data types, keep it simple. Adding Jan. 1st
when
only the year is known is a good default because it's a holiday when most
aren't working. So it's a visual cue that only the year is right.

Chris
Microsoft MVP
paii, Ron wrote:
The OP states that some fields take mm/dd/yyyy and others need only the
year. I don't think you would want to mix input formats in the same
field.
>
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Sep 15 '08 #9

P: n/a
There *aren't* any fields requiring only the year. Sometimes the users know
only the year when they're inputting data so they'd like to put it there but
it's a date field so won't accept only the year. Hence Sparks' question.

With your scenario there's 2 solutions:

1 - The date text box can be bound to the table but when only the year is
known, it can't be input into the same text box, meaning another text box on
the form. That additional text box would be unbound and need code to make it
work right.

2 - Use one unbound text box with the code to work with the input value
whether it's a full date or a year. Having unbound text boxes on a bound
form can produce problems when trying to save to record, especially if the
unbound text box is meant to transfer input to a required column.

Either way that's more code, more complexity, and more chances for errors and
frustration for the user.

Keep it simple. A bound date field.

Chris
Microsoft MVP
paii, Ron wrote:
>I agree with you to not break a date into 3 number fields. But why force the
users to enter a default day and month on the fields requiring only year?
The form can easily accept year input, append the default day and month,
then store it in a date field.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Sep 16 '08 #10

P: n/a
On Tue, 16 Sep 2008 02:08:16 GMT, "Chris O'C via AccessMonster.com"
<u29189@uwewrote:
>There *aren't* any fields requiring only the year. Sometimes the users know
only the year when they're inputting data so they'd like to put it there but
it's a date field so won't accept only the year. Hence Sparks' question.

With your scenario there's 2 solutions:

1 - The date text box can be bound to the table but when only the year is
known, it can't be input into the same text box, meaning another text box on
the form. That additional text box would be unbound and need code to make it
work right.

2 - Use one unbound text box with the code to work with the input value
whether it's a full date or a year. Having unbound text boxes on a bound
form can produce problems when trying to save to record, especially if the
unbound text box is meant to transfer input to a required column.

Either way that's more code, more complexity, and more chances for errors and
frustration for the user.

Keep it simple. A bound date field.

Chris
Microsoft MVP
paii, Ron wrote:
>>I agree with you to not break a date into 3 number fields. But why force the
users to enter a default day and month on the fields requiring only year?
The form can easily accept year input, append the default day and month,
then store it in a date field.

thank you all very much. I messed around with 2 fields as well as a ck
box to indicate year only. I thought about parsing what they had
entered into a text field and then putting that into the table, again
too much room for error. We decided on 01/01/2008 for year only.
I don't think we should get that as a valid date, maybe 1` in
10,000,000 so they said go with it.
Sep 16 '08 #11

This discussion thread is closed

Replies have been disabled for this discussion.