I am converting a Google Sheet to a SQL database table. When it loads the Excel sheet (I copy the Google Sheet data to Excel and import it) SQL changes some of the data types. I have a column in my Excel sheet that is a date that SQL converts to nvarchar. When I try to convert it back to a date data type, I get this error:
"Conversion failed when converting date and/or time from character string."
My code seems to be correct...I'll show you.
USE Sample
ALTER TABLE ['RM Item List$']
ALTER COLUMN [Kosher Cert] date
Can someone give me an idea why this doesn't work? I know questions about data conversion have been asked ad nausea, but I didn't see an answer that helped me solve my problem. SQL converted my dates in the Kosher Cert column to strings of five numbers. Any help would be appreciated.