473,587 Members | 2,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 14641
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.c om
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.c om"
<u29189@uwewrot e:
>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.c om
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.c om" <u29189@uwewrot e in message
news:8a3be40740 bb2@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.c om
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.c om
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.c om" <u29189@uwewrot e in message
news:8a3e063e40 ad1@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.c om
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.c om
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.c om" <u29189@uwewrot e in message
news:8a3e3ddac3 9f2@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.c om
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.c om
http://www.accessmonster.com/Uwe/For...ccess/200809/1

Sep 16 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2161
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 total newbie where he is going wrong or suggest a more elegant way of doing this. thanks Pete <head><script>
25
19835
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 appear. what can i do for that? should i use three input tags? but then, how can i make the cursor jump to the next field when typing in current...
30
3663
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 seems unnecessarily long. For some while, the following approach has been given here :- function ValidDate(y, m, d) { // m = 0..11 ; y m d...
4
43528
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 check. Let's go straight to the point: <script language="JavaScript"> alert("Date: "+Date.parse("2000-01-01"))
26
2689
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 to convert a latitude coord back to an accurate date time. Then I could detect the day/hour in the viewport when the timeline is zoomed in or out,...
12
29441
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 follows: function doDateCheckNow(source, args) { var oDate = document.getElementById(source.controltovalidate); // dd/mm/yyyy
11
10562
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)) || '-' || RTRIM(CHAR(YEAR(COVG_TYP_STRT_DT))) FROM twd_coverage_type 1...
4
2300
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
1341
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 (int) MinDate(datetime) MaxDate(datetime)
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8347
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.