title: How do I subtract two date columns and two time columns in sql
body: <p>I have 4 columns that are  </p>
  
  <pre><code>Startdate, 
  enddate, 
  starttime, 
  endtime.  
  </code></pre>
  
  <p>I need to get subtractions from the <code>enddate and endtime</code> - <code>startdate and starttime</code>.  I will need that answer from the four columns in sql.</p>
  
  <p>so far I have this I found but dont think this will work right.</p>
  
  <pre><code>SELECT DATEDIFF (day, enddate, startdate) as NumberOfDays  
  DATEDIFF(hour,endtime,starttime) AS NumberOfHours 
  DATEDIFF(minute,endtime,starttime) AS NumberOfMinutes 
  from table;
  </code></pre>
  
  <p>Thanks for your help</p>