June 22, 2010 at 6:28 am
I am trying to display in my report the number of days between Purchase_Date and Booking_Date.
I have written a Function in the Custom Code of the report as;
Function DispTypeString(value1 AS DateTime, value2 AS DateTime) As Long
Dim NumberOfDays AS Long
NumberOfDays = Datediff("d","Purchase_Date","Booking_Date")
Return NumberOfDays
End Function
The return fields' expression is:
=Code.DispTypeString(Fields!Purchase_Date.Value,
Fields!Booking_Date.Value)
I have been working on this problem for far too long and really need some expert help.
Bill
June 23, 2010 at 7:30 am
Can you not use the datediff function as a part of your extraction query?
June 24, 2010 at 9:50 am
Are you getting errors in the function. The code should be something like...
Function DispTypeString(value1 AS DateTime, value2 AS DateTime) As Long
Dim NumberOfDays AS Long
NumberOfDays = Datediff("d",value1,value2)
Return NumberOfDays
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply