Wednesday, March 21, 2012

Errors using DATEDIFF and DATEADD formulas

I am trying to use the DATEDIFF function in a formula, but it isn't
working. Here is the formula that I am entering into the "Define
Formula" dialog box:
DATEDIFF("day", TimeLogged, TimeClosed)
When I click ok, it gives me the message, "The arguments to the
following function are not valid: DATEDIFF". With that in mind, I
looked in the Help file for the report builder and under the "DATEDIFF
statement" documentation, it had the following example:
DATEDIFF("month", #1/1/2009#, #3/31/2009#)
This one yielded the same results. I also tried the DATEADD formula
and got the same type of error message. Other formulas, such as YEAR,
WEEK, etc. work fine.
Does anyone have any suggestions? I get the same results using both
the Report Builder and Visual Studio 2005.Hi,
the syntax is like this.
DATEDIFF("d", TimeLogged, TimeClosed)
This will work.
Amarnath.
"photogulliver" wrote:
> I am trying to use the DATEDIFF function in a formula, but it isn't
> working. Here is the formula that I am entering into the "Define
> Formula" dialog box:
> DATEDIFF("day", TimeLogged, TimeClosed)
> When I click ok, it gives me the message, "The arguments to the
> following function are not valid: DATEDIFF". With that in mind, I
> looked in the Help file for the report builder and under the "DATEDIFF
> statement" documentation, it had the following example:
> DATEDIFF("month", #1/1/2009#, #3/31/2009#)
> This one yielded the same results. I also tried the DATEADD formula
> and got the same type of error message. Other formulas, such as YEAR,
> WEEK, etc. work fine.
> Does anyone have any suggestions? I get the same results using both
> the Report Builder and Visual Studio 2005.
>

No comments:

Post a Comment