There is a field in the table that contains the salary value (type nvarchar (10), not I did). It is necessary that the request displays a bonus and total salary and bonus. Below is an example of a calculated premium.
declare @temp_table table ( user_salary nvarchar(10) ) insert into @temp_table (user_salary) values ('') insert into @temp_table (user_salary) values (NULL) insert into @temp_table (user_salary) values ('123') select (convert(float,isnull((case user_salary when '' then 0 else user_salary end),0))/2) as [prem] from @temp_table Is it possible to use this calculated value in the future or will I have to duplicate the code?
UPD. It is understood that the salary, the bonus, and their total amount should be displayed on the basis of the request.
floatfrom an expression or the result of a query? - Mirdinselect prem, perm + oklad from (ваш запрос) A- Mike