Solved

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

Posted on 2007-11-19
3
2,557 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
[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
  • 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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

735 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