How can i store year alone in a table? (4 digits. Eg.2001.) What Date format and input mask to use? I don't want to use either number or text format. Any help will be appreciated.
Access stores dates as double precision numbers (8 bytes). The integer part is a numeric representation of only the date. It is an offset from a fixed point in time (12/30/1899), and all dates are stored as the number of days before or since this date. Time is stored in the decimal part of the field.
Therefore, you will always have months and days represented. You can extract only the year with the Year, Datepart and Format functions.
Year(Date_col) returns an integer
Datepart("yyyy", date_col) returns an integer
format(date_col, "yyyy" returns a string
However, if all you want to store is the year, I recommend using an integer or text field. Terry L. Broadbent FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.