converting year and month varchar to date

  • I have a table with Month , Year as varchar. I realized it was a big mistake. Since its getting too complicated to query this way.

    Year Month Productname

    2013 11 ACB

    2013 11 CDE

    I would now like to add another column called date and store these Year Month as a date to my existing table

    Year Month ProductName Date

    2013 11 ACB 2013-11-01

    2013 11 CDE 2013-11-01

    Is there a way I can do it for all the columns of the existing table ??

    Please let me know

  • Please don't post on multiple forums.

    All replies in this thread: http://www.sqlservercentral.com/Forums/Topic1536945-3077-1.aspx

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply