Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting Text to date 1

Status
Not open for further replies.

kentwoodjean

Technical User
Oct 19, 2002
376
US
Have looked at several posts and there seem to be a ton of approaches and if it were not that my boss wants some cross tabs, I would not need to convert. CVS Files I am now importing have date field in text like "200401". For display purposes, I can change the field using Ndate: left(enddate,4) & "/" & right(Enddate,2)for 2004/01. But it is still text.

I want my crosstab to reflect the month & year format so the user can put in date parameters to pull a 12 month period of their choice.

Any simple way to make this happen? Thanks.
 

Why do Dates and Times seem to be so much trouble? faq68-5827
Code:
DateSerial(left(enddate,4), right(enddate,2), 1)


Skip,

[glasses] [red]Be advised:[/red]We know Newton's 3 Laws. But did you hear about the [red]FOURTH???[/red]
Only ONE fig per cookie![tongue]
 
You are very right in that dates and times cause trouble. Seems that each situation has a bit of a different twist and yet there are so many different ways to write the code.

I have to say that yours is the best yet! Easy - easy - easy.

Thanks so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top