title: how to add two different times in sql
body: <p>I have a function with the following code in it:</p>
  
  <pre><code>DECLARE @requestedtime datetime,
      @Timeintervel int,
      @TotalTime datetime 
  
  select @Timeintervel= datepart(MINUTE,l.Timeinterval)  
  from Location_tbl l 
  where l.LocName=@location
  
  select @requestedtime= t.Paydate 
  from Transaction_tbl t 
  where t.TBarcode=@cardID
  </code></pre>
  
  <p>I am trying to do this:</p>
  
  <pre><code>  select @TotalTime=    DATEADD(MINUTE,@requestedtime,@Timeintervel)
  </code></pre>
  
  <p>...but it returns the following error:</p>
  
  <p>Argument data type datetime is invalid for argument 2 of dateadd function.</p>
  
  <p>Input parameters:</p>
  
  <ul>
  <li><code>@timeintervalue</code>  15 (15 minutes)</li>
  <li><code>@requestedtime</code> is 2013-05-07 17:55:42.000 I want to add this two times.</li>
  </ul>
  
  <p>I want to get total time=2013-05-07 18:10:42.000</p>
  
  <p>How can I get that? What function do I have to use?</p>