Crystal is not adding that logic to your WHERE-clause because ShiftDateTime
is a Crystal Function and NOT a valid function your database can use. Basically, Crystal doesn't know how to translate it into valid SQL. This is nearly always the case when you use Crystal functions on database fields in the record selection formula.
So what happens in this case is that Crystal leaves off the WHERE-clause logic and just gets ALL the records from the database and then applies the selection locally...which is why you're seeing such a drastic performance slow down; you're getting all records from the database regardless of their shift start time.