I am trying to query from a temp table and i keep getting this message:
Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ' '.
Can somebody tell me what the problem is? Is it due to convert?
The query is
select compid,2, convert(datetime, '01/01/' + CONVERT(char(4),cal_yr) ,101) ,0, Update_dt, th1, th2, th3_pc , Update_id, Update_dt,1
from #tmp_CTF**
For the OP's command:
I get this error:
when debugging something like this split the long line up so you'll get a better row number:
this now results in:
which is probably just from the OP not putting the entire command in the question, or use [ ] braces to signify the table name:
if that is the table name.