Round Up Calculated Field or Format Expression in Report Builder 3.0

I'm attempting to use the DateDiff function to identify the number of minutes between two date time fields.  I need it round up to the next whole number.

My formula to count the number of minutes is as follows

The formula is working fine and resulting the correct number of minutes, but my problem is the rounding.  If the duration is 1.1 minutes, then I need it to round up to 2.  The basic rounding available in Report Builder 3.0 rounds in the traditional .01 t .49 down and .5 to .99 up.

Any suggestions would be greatly appreciated.  I'm looking for a calculated field or a format expression type of solution.
Who is Participating?
ValentinoVConnect With a Mentor BI ConsultantCommented:
SSRS also has a Ceiling implementation.  Here's how that would go:

  , CDate(Fields!Time_First.Value)
  , CDate(Fields!Time_Second.Value)) / 60)

Open in new window

Chris LuttrellSenior Database ArchitectCommented:
in T-SQL you could use CEILING(x) to return the next integer, CEILING(1.1) yields 2.
I am not sure if you can use that command in Report Builder or not and do not have a test environment to test it first, sorry.
I wonder if you can apply the MRound type Excell function like this description below....
I guess you'd multiply 25 and divide by 25? (ie. 5 tmes the example given or .2)

•The Round function is useful to round numbers to the nearest integer. The following expression rounds a 1.3 to 1:
= Round(1.3)
You can also write an expression to round a value to a multiple that you specify, similar to the MRound function in Excel. Multiply the value by a factor that creates an integer, round the number, and then divide by the same factor. For example, to round 1.3 to the nearest multiple of .2 (1.4), use the following expression:

= Round(1.3*5)/5

Having said that, I'd prefer to do the calcs in SQL first, then have that field pumped through into SSRS.
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

jaisy99Author Commented:
Thank you, tried ceiling, but looks like it won't take it and results in error.  Finally got it to work but it is three separate calculated fields.  It errors if I try to combine the last two calculated fields.  This will work for now.  But if anyone has an easier way, would like to use it.  
Thank you for your help.

Final solution that worked is:
Calculated Field 1 (see above)
Calculated Field 2 =INT (Fields!Calculated_Field_1.value)
Calculated Field 3 = Fields!Calculated_Field_2.value + .5
Good on you,

I think though, doing the Ceiling in SQL is a better option.

jaisy99Author Commented:
This was exactly what I was looking for.  Thanks to all.
ValentinoVBI ConsultantCommented:
Glad to have been of assistance, enjoy the weekend!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.