Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
I'm trying to copy 1 colunm to another in the same table. I keep getting this error message.

Msg 207, Level 16, State 1, Line 2
Invalid column name 'saledate_mmddyyyy'

The code that I'm using is

SQL
UPDATE VISION_SALEHIST 
SET saledate_mmddyyyy = SALEDATE


What I have tried:

SQL
USE taxpayer
SELECT FORMAT(SALEDATE, 'MM/dd/yyyy', 'en-US') AS [MM/DD/YYYY]
FROM VISION_SALEHIST4;"

This code did not work either
Posted
Updated 29-Sep-20 1:09am
v2

1 solution

The error message is telling you that you do not have a column named "saledate_mmddyyy".

Double-check the name of your column.
 
Share this answer
 
Comments
Chris Slinko 28-Sep-20 10:25am    
I exported the table to excel and I copied the name saledate_mmddyyyy and that seemed to work. Now I get the error message Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.VISION_SALEHIST'. When I double click on the error it highlights the UPDATE VISION_SALEHIST.
ZurdoDev 28-Sep-20 10:31am    
Same error. It does not know what dbo.VISION_SALEHIST is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900