Year storage

bjsteyn

Registered User.
Local time
Today, 22:04
Joined
May 15, 2008
Messages
113
How do u format a date to just enter a year in a table?plz bj
 
Format([myDate],"yyyy")
or
Year([myDate])

hth,
Sup
 
Yes, i know,but you still have 2 enter a whole date. I just want to enter the year. Do i use a text or number instead.thanx bj
 
How are you entering or getting the date in the first place?

If you are entering through a form, you can use the after update event.
me.txtmyDate = Year(me.txtmyDate)

If you are appending via query, you can format the column to append.
FieldtoAppend:Year([myDate])

Sup
 
And if you are saving only the year then the datatype in the table should be text and not date.
 
Thanx, thought of using a text. I stil need to use the year to compare to a date. How do format a string into a date
 
You aren't going to want to compare it to a date. You will need to extract the year from the date to compare against the string.

So,

[YourTextField] = Year([YourDateField])
 
Hey bob, how is ur project going? Mine turned out bigger than I thaught. So am adding a few stuff. The business I designed this program for is one of 21 franchises opening. It looks like they want to use it 4 the other franchises aswell.bj
 
Mine is only about a month and a half behind schedule.
 
beter late than never. What is it u r working on?
 

Users who are viewing this thread

Back
Top Bottom