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!

Date/Time custom format 2

Status
Not open for further replies.

lastout

Programmer
Apr 12, 2002
84
US
I have a field YearFiled in a table. The data type is Date/Time and I want the format to simply be yyyy. I put that in the field's format property but every time I enter a date, say 1973, it tells me what I've entered isn't valid for the field. Can anyone tell me what I might be doing wrong here?
 
if you really want to work like this then type 1/1/1973
or 1/1973

but you would better change the datatype to int works a lot better and smoother. and limit the input between 1900 and 2100 for example
Christiaan Baes
Belgium
"What a wonderfull world" - Louis armstrong
 
It sounds like you need to change the data type to be either text or number. If all your keying in is the year as a 4 digit field, or if you have to have the field as a data type of date/time you'll need to key it as 01/01/1973 knowing that the 01/01 portion of the date is not used.
 
great minds think alike Christiaan Baes
Belgium
"What a wonderfull world" - Louis armstrong
 
Thanks for the input. Funny thing though, isn't it? What good is the formatting yyyy if you still have to key in mm and dd? Or change the data type to integer when really it's a year. In the end, I guess it makes no difference. I'm just a wee bit nitpicky. Anyway, point taken - thanks again folks.
 
As it turns out in Access, the date format doesn't control input, it controls output.

Thus, you can enter a date such as 01/01/02 and, depending on your date format, it will be displayed as Jan-01-2003 or whatever.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top