Trying to use this code fragment to include or exclude records based on a user Boolean parameter (?Include OT) selection. When the parameter is False, it correclty excludes records with Modality.OT and also selects based on the ?Dates range. But when parameter ?Include OT is True, it correctly includes records where Modality is OT, but it ignores the "and" statement selecting on a date range. Since the 'if' and 'else' statements are single lines, i don't need parethesis to ensure the "and" statement is evaluated regardless of the parameter is True or False do i? what else am I missing? Thanks very much for any suggestions.
if {?Include OT} then
{DoctorDetail_Backup.Modality} in ["CR", "CT", "MR", "NM", "US", "OT"]else
{DoctorDetail_Backup.Modality} in ["CR", "CT", "MR", "NM", "US"]
and
Date({DoctorDetail_Backup.InputDateTime}) in minimum({?Dates}) to maximum({?Dates})