473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

can a date accept only a year

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
10 14597
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Pete | last post by:
Hi Guys I have a form which must calc the difference between 2 date fields and return the result in a third field. I have the following code but it does not seem to work. Can anyone tell this...
25
by: koray | last post by:
hi everyone, in my form i have to take some date information in dd-mm-yy format. but i don't want user to use tabs while typing. for example s/he should simply type 280104 but 28/01/04 must...
30
by: Dr John Stockton | last post by:
It has appeared that ancient sources give a method for Numeric Date Validation that involves numerous tests to determine month length; versions are often posted by incomers here. That sort of code...
4
by: Matteo | last post by:
Hy everybody. I'm not a html writer, but a sysadmin who's trying to help a user able to compile an online form with IE but not with Mozilla (Moz1.6, Ns7.1, Firefox 0.8+) due to a javascript date...
26
by: jshanman | last post by:
I am writing a timeline that uses Google Maps. I have a function that converts a date time to latitude coords. This function is used to draw the markers on the timeline. I need a reverse function...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
11
by: shsandeep | last post by:
I used the following query to retrieve the date in dd-mon-yyyy format. db2 => SELECT RTRIM(CHAR(DAY(COVG_TYP_STRT_DT))) || '-' || RTRIM(MONTHNAME(COVG_TYP_STRT_DT)) || '-' ||...
4
by: peterson | last post by:
We are trying to enter birthdays in a 00/00 date format, and it does not accept 2/29 or 02/29 as a legal date. Any work arounds for this? Thank you, Amy Peterson, MMI
0
by: brandonjack007 | last post by:
I am looking for a date custom web server control that exntends from System.Web.UI.WebControls The control will expose the following Properties Date (datetime) Month (int) Day (int) Year...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.