Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enter date as year only on a form 1

Status
Not open for further replies.

punky

Programmer
Mar 21, 2001
29
US
How do I either format or create an input mask that uses only year as valid input. The user does not want to enter month and day on the form. Do I change the table or the form or both and what does the format or input mask look like to accomplish this. At the table level, is the data type date/time short?
 
if it was me and they were only going to do store the year I would change the datatype to a number. You truly are not storing a date and as a number any sorting or grouping will not be affected. BUT I would ask the customer why only the year. What if they wanted to look at the data based on months, quarters, etc... If it is a data entry problem use the calendar.
 
I would agree with the above in terms of using a number instead of a date field. I have done this in the past and it works well.

Also, I recently wrote a program for a customer that decided at the last minute they wanted to view info the same as their year end, which was Sept. 30., and not Dec 31. I had to go back an redo all my calculations as the year alone was not enough to separate the fiscal periods.

Anyway, some friendly advice...

Jenny
 
Thanks everyone,

I agree with the reponses. The year is being used to flag year of a car on a database tracking vehicles. I will talk it over (AGAIN) with the users.
 
Punky, it may be better to have a drop down combo box, and limit it to list add say the next 100 years in it.
if you have no plans to calculate the year field and you want to keep it a field try making it text rather than number, this way you can limit it 4 characters as well as adding a mask lets say 2*** that way the user can not botch up the data entry section and you dont end up with a year like 2003929292...

Hope this help

Zero
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top