Skip to main content
Inspiring
July 6, 2006
Answered

Converting String to date type

  • July 6, 2006
  • 3 replies
  • 356 views
I'm trying to post gif files (comic strips) by date based on a series of characters in the name of the file.

For example: a file name is 'ft060618.gif' where the '060618' indicates the year, the month and the day respectively.

I used ReReplaceNoCase() to strip the 'ft' and '.gif' from the string.

Now I have the value '060618' and I need to convert this to a date type so I can list the comic strips by today's date as well as perhaps the last five days worth.

Thanks.

Scott

This topic has been closed for replies.
Correct answer
The following returns mm/dd/yy

3 replies

Inspiring
July 6, 2006
THANKS!

I tried jdeline's solution and it is just what I needed.

Inspiring
July 6, 2006
CreateDate(left('060618',2),mid('060618,3,2),right('060618',2)).

I think I have creatdate() in the correct order of year,month,day, check
the docs. Obviously using a variable and not the hard coded strings
would be much more versatile.

ScottAtHelloMetro wrote:
> I'm trying to post gif files (comic strips) by date based on a series of
> characters in the name of the file.
>
> For example: a file name is 'ft060618.gif' where the '060618' indicates the
> year, the month and the day respectively.
>
> I used ReReplaceNoCase() to strip the 'ft' and '.gif' from the string.
>
> Now I have the value '060618' and I need to convert this to a date type so I
> can list the comic strips by today's date as well as perhaps the last five days
> worth.
>
> Thanks.
>
> Scott
>
>
>
Correct answer
July 6, 2006
The following returns mm/dd/yy