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.

[163 byte] By [Kamii47] at [2008-1-1]
# 1

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

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

Shyam

ShyamSundar at 2007-9-12 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 2

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

Jarret at 2007-9-12 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 3
Can u please mark my post as answer?
ShyamSundar at 2007-9-12 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...

SQL Server

Site Classified