Solved

Format as date MS Access

Posted on 2013-06-13
6
615 Views
Last Modified: 2013-06-14
Can someone please provide me with the code for me to put it in a Microsoft access query to format a date?

the current format is as follow: 06132003

I like to format it as 06/13/2003 but the data is stored in the text field with the above format.

I like to change it with a query and make a new table with the new date format..

I just need the code to be able to that...
0
Comment
Question by:TonyEF
6 Comments
 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 400 total points
ID: 39246080
Is it a Date field or a Text field?  If it is Text, you can convert it to a date using the CDate function and some String functions:

CDate(Left([TextDate],2) & "/" & Mid([TextDate],3,2) & "/" & Right([TextDate],4))

Save the Date value to a Date field, and set its format as desired in the Format field.
0
 
LVL 29

Assisted Solution

by:IrogSinta
IrogSinta earned 75 total points
ID: 39246367
This should work too:
CDate(Format([TextDate]","##/##/####")
0
 
LVL 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 25 total points
ID: 39246699
Or - without typos:

RealDate: CDate(Format([YourTextDate],"@@/@@/@@@@"))

/gustav
0
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.

 
LVL 29

Expert Comment

by:IrogSinta
ID: 39247090
Correction:
CDate(Format([TextDate],"##/##/####")
Thanks for pointing that out, gustav
0
 

Author Closing Comment

by:TonyEF
ID: 39248902
thank you all...
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39249108
You are welcome!

/gustav
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

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

911 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

19 Experts available now in Live!

Get 1:1 Help Now