Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2567
  • Last Modified:

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

I am trying to covert the following text field 19970519 to a date field in Access 2003. This text field is in YYYYMMDD.
0
VFtechnology
Asked:
VFtechnology
  • 2
1 Solution
 
rockiroadsCommented:
something like this perhaps

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

0
 
Rey Obrero (Capricorn1)Commented:
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
 
rockiroadsCommented:
VFtechnology
just out of interest, did dateserial not work for you? be interested to know where its failings with regards to your code
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now