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

=DateDiff not working as expected

$
0
0

Hi, 

I'm very new to Report Builder 3.0 and indeed very new to SQL as well. I am slowly learning both. I am trying to build a finance report. The SQL database has records of entries which show the bill amount and bill date. The date is in format dd/mm/yyyy 00:00:00

The report needs to show the sum totals of bills based on their age. I have columns for 30days, 30-60 days, 60-90 days, etc.

I appreciate I first need to work out the age of a bill. I am attempting to use DateDiff for this. As a very easy starting point I am simply trying to work out difference in number of days between a bill date and today's date. For this I am using

=DateDiff("dd",Fields!BillDate.Value,Now())

When I run my report I get "#Error" in that cell. If I attempt to test these two values independantly, it works. Such as 

=Fields!BillDate.Value

I get the expected output, such as 29/07/2014 00:00:00. If I test the Now function with

=Now()

I get 12/11/2014 14:48:43 (the current date and time)

So, what am I doing wrong?



Viewing all articles
Browse latest Browse all 10045

Trending Articles



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