Create Date from MMDDYYYY

I'm trying to find the best way to create a function to create a date in the format of MM/DD/YYYY from MMDDYYYY.  I've looked around but haven't been able to find anything that works.  I've tried convert() and a couple of other things but it doesn't recognize that format as a date.  I can't get the format that's provided changed.  

Thanks in advance for any help.
LVL 15
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Patrick MatthewsCommented:
SELECT SUBSTRING(SomeDate, 1, 2) + '/' + SUBSTRING(SomeDate, 3, 2) + '/' + SUBSTRING(SomeDate, 5, 4)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
select to_char(to_date(mydate,'MMDDYYY'),'MM/DD/YYYY')
It depends.
Where does your 'MMDDYYYY' come from? What datatype is it originally? And what are you trying to do? Is it for database input from some outside parameter? Or for ouput in your web application? Or processing inside database?
tim_csAuthor Commented:
matthewspatrick's suggestion seems to be working so far.  I'm just doing some more testing.  

I'm importing data into a temp Table from a flat file.  Then processing the data to be stored in the proper DB tables.
I see. Then yes, it's a string, with all the string functions available to your disposal
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.