Search code examples
vb.netreporting-servicesrdlc

DateDiff in my VB.Net's RDLC Returns #error


I'm working on an RDLC report in Visual Studio Pro 2013 Report Builder (VB). I have a function (below) using the DateDiff() function where the value results to #error:

=DateDiff("dd", Fields!DateFrom.Value, Parameters!pfDateTo.Value)

This gets the number of days from one of my fields compared to a parameter which is a DateTime datatype. No null values resulted in my query.

Am I missing something? How can I fix this?

thanks in advance.

here is the image that displays the dates here is the image that displays the dates

Using one "d" results to 141?: Using one "d"


Solution

  • Its just one "d" and make sure that the values are dates. This way it should work:

    =DateDiff("d", CDate(Fields!DateFrom.Value), CDate(Parameters!pfDateTo.Value))