Reformat date/time entry in nvarchar field

I currently have a field which is 'ExpiresOn' it is a varchar (25)

Sometimes user will enter a date and sometimes something else like "NA".
Problem I had is we added date & time in that field so then it displays in the database as "May 11 2011 12:00AM"

I need a query that will reformat any entry that is a date time with the format above to the following format:  mm/dd/yyyy, using the example above it would be 05/11/2011

Help is greatly appreciated.  Example of entries in my DB attached.

Table name is "Users"
Field name is: "ExpiresOn"
screenshot.PNG
LVL 1
AleksAsked:
Who is Participating?
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.

Deepak ChauhanSQL Server DBACommented:
select convert(varchar(10), ExpiresOn, 103)
from Users
0
AleksAuthor Commented:
That only made a selection. I need to update the value
0
AleksAuthor Commented:
Any other ideas ?  It didn't reformat the fields :$
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Vitor MontalvãoMSSQL Senior EngineerCommented:
How are you inserting the date values? Also, there's a record with 'DS'. What that means?
0
AleksAuthor Commented:
I am not worried about the insert, that was fixed. I want to fix the entries that are already in the database.
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Deepak tried to teach you how to fish and you didn't get it but here's the fish:
UPDATE Users
SET ExpiresOn = CONVERT(VARCHAR(10), ExpiresOn, 103)
WHERE ISDATE(ExpiresOn) 

Open in new window

0
AleksAuthor Commented:
I apologize I am trying to meet a deadline ... let me test this. Ill try and learn how to fish next time around.
0
AleksAuthor Commented:
I first tried a select with your code but there is a syntax error:

SELECT  UserId ,
        ExpiresOn
FROM    dbo.Users
WHERE   ISDATE(ExpiresOn)
ORDER BY ExpiresOn DESC

--- error---

Msg 4145, Level 15, State 1, Line 3
An expression of non-boolean type specified in a context where a condition is expected, near ')'.
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
Sorry, my fault. Didn't test it.
UPDATE Users
SET ExpiresOn = CONVERT(VARCHAR(10), ExpiresOn, 103)
WHERE ISDATE(ExpiresOn) = 1

Open in new window

0

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
AleksAuthor Commented:
Thanks
0
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
Query Syntax

From novice to tech pro — start learning today.

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.