convert varchar(10) = '2014-04-06' to mmddyyyy format.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jl98
    New Member
    • Apr 2014
    • 1

    convert varchar(10) = '2014-04-06' to mmddyyyy format.

    Other than using substring('2014-04-06',6,2) + ... Is there a better way to convert the varchar column value to MMDDYYYY format ?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I wouldn't say it's better but you could use the convert function with style 101 and use a replace to remove the forward slashes.

    Comment

    • Luuk
      Recognized Expert Top Contributor
      • Mar 2012
      • 1043

      #3
      Code:
      select convert(datetime,'2013-04-06')
      more readings: here

      Comment

      Working...