• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1513
  • Last Modified:

converting mm/dd/yy to mm/dd/yyyy

I'm working with a DB column in which I need to update all the date values from mm/dd/yy to mm/dd/yyyy, since i'm not a SQL expert I'm a little stumped.

Also, This date column is a varchar instead of datetime.

I'm not sure how the point awarding works, will 100 be enough?
0
ken1906
Asked:
ken1906
1 Solution
 
DonKronosCommented:
This will result in a char column of length 10 having the format mm/dd/yyyy.

convert(char(10),cast(yourcolumn as datetime),101)

The points are fine.  Use more for tough questions or if you need an urgent response.
0
 
ken1906Author Commented:
Thank you very much.  I greatly appreciate the help.
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Tackle projects and never again get stuck behind a technical roadblock.
Join Now