1

I have a SSRS report that has one column called startime that is listed in mm:dd:yyyy hh:mm:ss format. For the header of this column I want to minus the first date from the second date to give me an idea of how long is between the two dates, this will likely be in minutes.

I don't need a running total, I just need to be able to minus the first date from the second date in the column will be good enough. I have bee playing around with the following but its throwing up some strange results.

=Fields!StartTime.Value - Previous(Fields!StartTime.Value)

Does anyone have any ideas?

Thanks

3
  • What does "strange results" mean? While simple subtraction works with the old datetime types (e.g. GETDATE()-1), you shouldn't do this. Does SSRS support any of the DATEADD() or DATEDIFF() functions? If not, can't you change the query to provide this information? Aug 18, 2014 at 14:42
  • It means in some cases I got high positive numbers and in others negative numbers, which don't add up if doing a subtraction. It does support the DATEADD() and DATEDIFF() functions, however I don't know how to reference only the first two items of data in the column.
    – Tom
    Aug 18, 2014 at 14:47
  • Ohhhhhhhh. You want to subtract something. Now I get it.
    – swasheck
    Aug 18, 2014 at 22:54

1 Answer 1

1

Can you do the calculations in the dataset the report uses? May have an easier time doing that then building the expression needed to calculate the column for SSRS

1
  • Yes I think I will look at doing it that way instead.
    – Tom
    Aug 19, 2014 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.