I am trying to display a particular string using an if else statement based on the value of a date/time object.
I am using a formula editor which checks for syntax and I get no problems, however when the formulas is parsed in the application I get blanks where the condition should be met.
Here is my formula:
if (System.Convert.ToInt32(rpt.Fields["AppointmentResourceLink.Appointment.Patient.DateDied"].Value)>0)
{
return System.Convert.ToString(rpt.Fields["AppointmentResourceLink.Appointment.Patient.FirstName"].Value) + " " + System.Convert.ToString(rpt.Fields["AppointmentResourceLink.Appointment.Patient.LastName"].Value) + '\n' + "Deceased: " + System.String.Format("{0:dd/MM/yyyy}",rpt.Fields["AppointmentResourceLink.Appointment.Patient.DateDied"].Value);
}
else
{
return System.Convert.ToString(rpt.Fields["AppointmentResourceLink.Appointment.Patient.FirstName"].Value) + " " + System.Convert.ToString(rpt.Fields["AppointmentResourceLink.Appointment.Patient.LastName"].Value);
}
The Formula editor allows conversion to different data types and I've tried revising the formula with the returned value as Boolean but this doesn't work either.
Thanks