Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Total number of days between two dates.

$
0
0

Hi,

I am using report builder 3.0

I have two date fileds (Datein and Dateout) I require the total number of days between these two dates, including day in and day out.

I have tried the datediff function but does not give me total number of days correctly.

=DateDiff("d",Fields!DateIN.Value,Fields!DateOut.Value) + 1

Example results.

DateIn                         DateOut                          Day Total

19/12/2012 14:39:59   31/12/2012 09:01:49          12
19/12/2012 14:40:40   30/12/2012 21:56:43          12

Would like the first row above, day total to be 13.

I have tried the DatePart function but this fails if dates spans more than 1 year.

=DatePart(DateInterval.DayOfYear,Fields!DateIn.value) - DatePart(DateInterval.DayOfYear,Fields!DateOut.Value) +1

Example

DateIn                          DateOut                         Day Total

18/12/2012 15:41:14    02/01/2013 14:01:46       -350
19/12/2012 14:39:59    31/12/2012 09:01:49         13

Any help would be appreciated.

Steve





Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>