After trying many things over many days, I need help figuring out why the selection criteria I am using is not working. I am accessing an OBDC datasource using Crystal version 10. I am trying to pull records canceled or added on a given date which are identified using certain criteria. Also, when I "SHOW SQL query", it does not show the OR statement used to identify cancels and adds.The following code pulls the canceled record for the day but not the added record. If I switch the order in the OR (add criteria first), nothing is pulled.
{appt.resunit_id} = {?ResUnitID} AND
{res.restype_id} = 2 AND
(({schedlog.audittype_id} = 3 and
{apptcancel.last_sched_datetime} = (CurrentDate) and
{apptcancel.canceled_datetime} = (CurrentDate)) OR (({appt.start_datetime} = (CurrentDate)) and
(Date({appt.entered_datetime}) = Date({appt.start_datetime})) and
({schedlog.audittype_id} = 2)))
Any help would be greatly appreciated!!!
{appt.resunit_id} = {?ResUnitID} AND
{res.restype_id} = 2 AND
(({schedlog.audittype_id} = 3 and
{apptcancel.last_sched_datetime} = (CurrentDate) and
{apptcancel.canceled_datetime} = (CurrentDate)) OR (({appt.start_datetime} = (CurrentDate)) and
(Date({appt.entered_datetime}) = Date({appt.start_datetime})) and
({schedlog.audittype_id} = 2)))
Any help would be greatly appreciated!!!