Solved

Convert Date value in Access

Posted on 2013-11-27
4
537 Views
Last Modified: 2013-11-27
I have a field in a table where the date is stored as mm/dd/yyyy, i would like to convert the date in those fields to   mm/yyyyy.


How can I do this?
0
Comment
Question by:seamus9909
  • 2
4 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39680700
is this a text field?

If it is a date, you can change the display format of the date, but not the actual data itself.  Or you could create a query based on that table that displays the date field in that format using the format function:

MonYr: Format([DateField], "mm/yyyy")
0
 
LVL 26

Accepted Solution

by:
Shaun Kline earned 500 total points
ID: 39680704
The format command works (assuming you meant four Y's):

Format(<date>, "mm/yyyy")

If you meant storing them in that format, you would need to convert the field to a string. The date field always stores a full date, and it is up to the user to display the date in the format they choose.
0
 

Author Comment

by:seamus9909
ID: 39680712
do I put that in a query or can I change the table values themselves?
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39680718
BTW, when I said you can change the display format, I meant in the table design view.  If you set the Format property on the General Tab of the Field Properties in table design view, the data will be displayed as mm/yyyy, but when you put your cursor in the field, it will display as the actual data.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question