Friday, March 23, 2012

inexperienced sql user Calculating total days between datefields

I have two fields
Date entered|Date left
and i need to calculate the difference in days between the two fields to
look like this
Date entered|Date left|Total days taken
I am trying to use the datediff command like
=datediff(d,Fields!dateentered.value,Fields!date_left.value)
But this isnt working. Anyone have any ideas how i can do this?No matter i found that doing the datediff in the select statment rather than
in an expression works.
"Shaun Longhurst" wrote:
> I have two fields
> Date entered|Date left
> and i need to calculate the difference in days between the two fields to
> look like this
> Date entered|Date left|Total days taken
> I am trying to use the datediff command like
> =datediff(d,Fields!dateentered.value,Fields!date_left.value)
> But this isnt working. Anyone have any ideas how i can do this?|||Place the calculation on the DataSet and reference it in the report table
just as any other column.
What exactly isn't working?
The following syntax works for two dates inside a SQL Select statement:
DATEDIFF(d, FirstDate, LastDate) AS DurationA
"Shaun Longhurst" wrote:
> I have two fields
> Date entered|Date left
> and i need to calculate the difference in days between the two fields to
> look like this
> Date entered|Date left|Total days taken
> I am trying to use the datediff command like
> =datediff(d,Fields!dateentered.value,Fields!date_left.value)
> But this isnt working. Anyone have any ideas how i can do this?

No comments:

Post a Comment