title: How to add the scalar variables and store the result in another scalar variable
body: <pre><code>declare @Maxamount int,
          @month varchar,
          @Duration int,
          @iReturn int
  
  set @month = (select DATEPART(MM,start_date) from TC_Project_Referal where id_tc_projuser = @id_tc_projuser)
  set @Duration = (select fixeddDuration from TC_Project_Referal where id_tc_projuser = @id_tc_projuser)
  
  select @Maxamount = @month+@Duration-1
  </code></pre>
  
  <p>Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , >, >= or when the subquery is used as an expression.    i have more than 1 record in the database. data will be display based on the id. we can have mutiple records for the single id also .then how to</p>