When running this query
update p_leave_allocation_14122015
set 'month' + @actualMonth = @actualleavedays
where year = @actualYear
and emp_card_no = @emp_card_no
I get an error message:
Incorrect syntax for about a month.
The table p_leave_allocation_14122015has columns of type month1, month2, month3, .....
In my update request, I want it to monthbe hard-coded and the month of the month will be dynamic based on some conditions that I wrote.
But when I tried with the above request, I got the indicated error.
I am using SQL Server 2005.
Request to offer
source
share