How do I convert this Crystal Report IF statement for use in a WHERE clause in Reporting Services?
- by Spacehamster
I'm trying to translate this Crystal Reports IF Statement for use in a WHERE clause -
{@receipt_datetime_daylight} in {?DateRange} and
(if {?Call Sign} = "All Call Signs" Then
{cacs_incident_task.resource_or_class_id} = {cacs_incident_task.resource_or_class_id}
Else If {?Call Sign} = "All Sierra Call Signs" Then
{cacs_incident_task.resource_or_class_id} in ["S10", "S11", "S12"]
Else If {?Call Sign} = "All Whiskey Call Signs" Then
{cacs_incident_task.resource_or_class_id} in ["W01", "W02", "W03"]
Else
{cacs_incident_task.resource_or_class_id} = {?Call Sign}) and
(if {?OffenceType} = "All Offences" Then
{cacs_inc_type.description} = {cacs_inc_type.description}
else
{cacs_inc_type.description} = {?OffenceType})
CASE statements don't work in Reporting Services, so I need to find a why of translating this into a WHERE clause. Does anyone know a way?