Solved

date format - MS Access 2010

Posted on 2013-06-17
7
707 Views
Last Modified: 2013-06-17
My date in access table is in ddmmyyyy (29052013) format, how can i convert that in to mm/dd/yyyy format? I have around 600 rows in the table, Please help
0
Comment
Question by:gtmathewDallas
  • 4
  • 3
7 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 39253782
What is the datatype of your date field?
0
 

Author Comment

by:gtmathewDallas
ID: 39253789
Its in number
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 39253820
Then you need to create a new field in your table which is a datetime field.  You can set the format of that field to whatever you want to see displayed.

You then need to use an update query to convert the existing value to a date and place it in the new field.  That will involve quite a long expression.

Your query sql will be your version of this..

Update tablename set newfieldname =
dateserial(right(cstr(fieldname),4), mid(format(fieldname, "00000000"),3,2), left(format(fieldname, "00000000"),2))
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Closing Comment

by:gtmathewDallas
ID: 39253845
Thanks A Lot For This Perfect Answer.. It is working...
0
 

Author Comment

by:gtmathewDallas
ID: 39254020
I am sorry it worked but not in the desired format.. actually the date was in yyyymmdd (20130616) format and  I have to change to mm/dd/yyyy (06/16/2013). I tried with some changes in above code but not getting the result.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 39254205
The example you gave in your original Q does not look like yyyymmdd.

Update tablename set newfieldname =
dateserial(left(format(fieldname, "00000000"),4), mid(format(fieldname, "00000000"),3,2), right(format(fieldname, "00000000"),2))
0
 

Author Comment

by:gtmathewDallas
ID: 39254411
Yes It is working fine - I changed mid(format(fieldname, "00000000"),3,2) to mid(format(fieldname, "00000000"),5,2)
Thank You..
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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.

813 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

15 Experts available now in Live!

Get 1:1 Help Now