Sunday, February 19, 2012

I need help ASAP with SSRS Date Expression

I have a report which has a date like 01/05/2007 for a bill date in on Column I have todays date in another column I have a tird colum which need the total number of days from date of the billed date. I need to create and expression which will take the current date and subtract the number of days from todays date and give a total number of days. How do I get thew current date in the expression.

the billed date expression is =FormatDateTime(Today()) - FormatDateTime(Fields!BILLDATE.value,2) I can not get this to work

Any help would be appreciated

Hey,

you can try something like this:

privateint GetDaysBetweenDates(DateTime firstDate, DateTime secondDate)
{
return secondDate.Subtract(firstDate).Days;
}

Hope this helps.

No comments:

Post a Comment