0

I would like to know how to calculate difference between two datetimes in sql server reporting services report and putting the result in the next column.

For example difference between the two highlighetd values:

enter image description here

abdul.badru
  • 511
  • 2
  • 6
  • 18
  • Did you research this question at all? Possible duplicate of [How to calculate number of days by two dates in SSRS formula field](https://stackoverflow.com/questions/6491471/how-to-calculate-number-of-days-by-two-dates-in-ssrs-formula-field) – Steve-o169 Jul 25 '19 at 12:24
  • Can you do it in a SQL stored proc and use LAG()? – SS_DBA Jul 25 '19 at 19:36
  • 1
    you can try something like =DateDiff("d",Fields!entry_date.Value, previous(Fields!exit_date.Value)) – Harry Jul 25 '19 at 20:42
  • If `Previous()` isnt working for you (because `Previous()` depends on the sort order which doesnt have to fit to you scenario), you can create two datasets (one with the left date and one with the right date. Then you join them with a `Lookup()`. Now you have both dates in one row and you can simply use `DateDiff()` – Strawberryshrub Jul 29 '19 at 07:31

0 Answers0