Solved

Microsoft, Access, 2003, convert 19970519 text to date format

Posted on 2007-11-19
3
2,553 Views
Last Modified: 2008-02-01
I am trying to covert the following text field 19970519 to a date field in Access 2003. This text field is in YYYYMMDD.
0
Comment
Question by:VFtechnology
  • 2
3 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 20315240
something like this perhaps

mydatefield = dateserial(left$(mytextfield,4), mid$(mytextfield,5,2), right$(mytxtfield,2))

0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 20315271
cdate(mid("19970519",5,2)&"/"& mid("19970519",7,2)&"/"&left("19970519",4))

or

cdate(mid([datefield],5,2)&"/"& mid([datefield],7,2)&"/"&left([datefield],4))
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 20321518
VFtechnology
just out of interest, did dateserial not work for you? be interested to know where its failings with regards to your code
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

786 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