I really do not want to have to do dateparts for all my forms and queries. Is there a way to store in a table the date/time but place something below that does datepart(four digit year)?
I really do not want to have to do dateparts for all my forms and queries. Is there a way to store in a table the date/time but place something below that does datepart(four digit year)?
What do you mean by 'something below'?
You could use a Calculated field in table: Year([datefield])
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
You can format it anyway you want. yy if needed.
In table design where there is the format, input mask, caption, default value, etc.............I want to just have the years 2013, 2014, 2015, etc. I do not want the entire data to be displayed in the table or on any forms. So, I want to do date and time for data type but where would I put this year([datefield])
My expression is for use in a Calculated field type.
The Calculated field type was introduced with Access 2010.
If you want to have full date value saved into table then need a date/time field for that. Then if you want to show only parts of that saved date, use calculations to extract. The extraction can be done in query or in textboxes or in a table Calculated field. Create a new field in table, select Calculated as field type and a wizard pops up. Access Help has more guidelines.
If you don't want to even save a full date value and only offer users years as choices, then create a number type field and set it for Combobox. Build the combobox RowSource from a table that has a record for each year or build a Value List. Access Help has more guidelines.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
That did it. Thanks