[AccessD] YYYYMMDD string to date

jwcolby jwcolby at colbyconsulting.com
Fri Aug 10 08:26:54 CDT 2007


And about as easy to do, since the left/mid/right is what I used anyway.   


John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Friday, August 10, 2007 7:53 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] YYYYMMDD string to date

Hi John

Parsing is about 5 times faster than using CDate(Format(...)):

    datDate = DateSerial(Left(strDate, 4), Mid(strDate, 5, 2),
Right(strDate, 2))

/gustav

>>> jwcolby at colbyconsulting.com 10-08-2007 04:06 >>>
Is there a neat way to change a string date in YYYYMMDD format to a date?  I
can write a function to parse the pieces etc but wondered if there is just
something built in to Access that will do it.  Cdate() does not like it.

John W. Colby
Colby Consulting
www.ColbyConsulting.com 



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list