We help IT Professionals succeed at work.

Wrong date format in tables

Alex Lord
Alex Lord asked
on
64 Views
Last Modified: 2019-01-30
dates
So i have a table with these dates,

they are in wrong format,

what sql can i use to reformat these dates to

day/month/year

?
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
What database?
Is it an actual date data type or a string/varchar data type?

Author

Commented:
it is a varchar
Sharath SData Engineer
CERTIFIED EXPERT

Commented:
you can try this.

select convert(varchar(10), convert(datetime, date_column), 103) from your_table

Open in new window

CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
>>it is a varchar
What database product?
Database Developer
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
I agree i am fixing someone mistake lol
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.