Solved

Convert Date value in Access

Posted on 2013-11-27
4
532 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now