title: Trying to convert total minutes from a datediff to days, remaining hours, & minutes in Crystal Reports
body: <p>I am using Crystal Reports 2013 SP5 on Windows 7 Pro pulling from an Oracle db.</p>
  
  <p>I am trying to write a formula(s) in crystal reports that returns the total number of days the remaining hours if less than 24, and the remaining minutes if less than 60 from a datediff between two date time fields.</p>
  
  <p>So far I have managed to show the total number of minutes as days, hours, and minutes: </p>
  
  <pre><code>local numbervar tm := datediff('n',{table.date1},{table.date2},0);
  local numbervar h := truncate(tm/60,0);
  local numbervar d := truncate(tm/1440,0);
  
  local stringvar tm_d := totext(d,0,"") + ' days ';
  local stringvar tm_h := totext(h,0,"") + ' hours ';
  local stringvar tm_m := totext(tm,0,"") + ' minutes ';
  
  local stringvar tm_string := tm_d &amp; tm_h &amp; tm_m
  </code></pre>
  
  <p>Returns:  183 days 4393 hours 263633 minutes</p>
  
  <p>183 days which is = to 4393 hours which is = to 263633 minutes </p>
  
  <p>What I need it to do is show 183 days (not rounded) and any remaining hours (not rounded) and any remaining minutes (not rounded) so it looks something like this:</p>
  
  <p>The difference between table.date1 and table.date2 is:</p>
  
  <p>183 days 4 hours 23 minutes (just used random hours and minutes)</p>