Bit of a weird ask, but I have rows and rows of year/months as a string and i'm trying to convert it into date format.
Not too sure this can be done as it's not a full date but worth an ask.
UPDATE table SET [Year Month] = CONVERT (DATE, [Year Month], 103) Returns
Conversion failed when converting date and/or time from character string. String of data looks like this:
|Year Month| | 2015-02 | | 2016-06 | | 2016-01 | | 2020-09 | Have seen other posts but they all stem from having the full date already and just essentially cutting of the day to grab the year month etc. but in this case its only year and month that I have as a string and is needed to format into date year and month
01or end of month? or something else?select @@versionDATEit must be a valid date. And the valid date hasdaydefined.