?
Solved

date format - MS Access 2010

Posted on 2013-06-17
7
Medium Priority
?
713 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

765 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