Calculating days from two dates
So i have a report viewer showing data but in one of my columns i want to show the calculated 开发者_StackOverflowdays based off the previous two columns of dates in an expression property i can apply for the text box. Example of what i am trying to do
8/1/2011 8/19/2011 18 days
(endDate - startDate).TotalDays
Substraction on two DateTimes produces TimeSpan object, which has TotalDays property
Or try DateDiff("d", endDate, startDate)
(for Visual Basic only)
精彩评论