Friday, February 24, 2012

How to calculate a date difference in days

Suppose I have these two days fields
ddold 1/1/2005 12:00:00 AM
ddnew 2/1/2007 12:00:00 AM

How can i get the DateDifference of these two dates in days.

Use DateDiff(DateInterval.Day, Fields!Date1.Value, Fields!Date2.Value)

Where date1 is the start date and date2 is end date.

Shyam

|||

Hello Kamii,

If you're wanting to do this from your SQL query...

select datediff(d, ddold, ddnew)

If from Reporting Services, use this as your expression...

=DateDiff("d", Fields!ddold.Value, Fields!ddnew.Value)

Jarret

|||Can u please mark my post as answer?

No comments:

Post a Comment