Hi
I'm trying to apply some custom date formatting.
So I have created a method to format the date (where parameter dt is the Field from the database)
And for the expression I wrote:
If a DBNull value is returned from the database then I get the error "The expression contains undefined function call FormatDate()."
I don't understand why the error is occuring when I am using the IsNull() function.
I'm trying to apply some custom date formatting.
So I have created a method to format the date (where parameter dt is the Field from the database)
| public static string FormatDate(DateTime dt) |
| { |
| string newDt = ""; |
| if (dt != null) |
| { |
| string oid = waSessionState.Current(HttpContext.Current).oid; |
| waOrganisation org = (waOrganisation)HttpContext.Current.Cache[oid]; |
| newDt = dt.ToString(org.DateFormat); |
| } |
| return newDt; |
| } |
And for the expression I wrote:
| =waMemberDetailsReport.Utilities.FormatDate(IsNull(Fields.[MemberDateRegistered], null)) |
If a DBNull value is returned from the database then I get the error "The expression contains undefined function call FormatDate()."
I don't understand why the error is occuring when I am using the IsNull() function.