Mandy,
while it may give you the desired range of records to set a filter after you query with the unmended WHERE clause, it's a far better solution to mend the where condition so you get this result without adding in a filter as aftermath.
Understand what you're conditoin is asking for is all data for LOD but only a specific time range for CSH, because the AND condition only is applied to all CSH data, the OR separates LOD from that, ALL of LOD data. Maybe you didn't realize that CWSH data already was limited to the time range.
The aftermath filter says you want that same timerange for all data, also for LOD. And that's what you can get in one go, too, just put it right. Don't stick to this hack of a solution.
Lets look at what you do by making it a two step process. You first apply the filter
Code:
transcode = "LOD" OR transcode = "CSH" AND BETWEEN(ttod((deyt)),start,ind) && call this condition1
Then you apply a second filer as aftermath:
Code:
BETWEEN(ttod((deyt)),start,ind) && call this condition2
Putting that together meanns the overall filter is:
Code:
(condition1) AND (condition2)
And intentionally I put in the paranthesis, though using the names condition1 and condition2 for the whole conditions doesn't need parantheses. But if you substitute in the actual expressions, you need them. Substituting in the terms you get:
Code:
(transcode = "LOD" OR transcode = "CSH" AND BETWEEN(ttod((deyt)),start,ind)) AND (BETWEEN(ttod((deyt)),start,ind))
That doesn't only look a bit redundant, it can be simplified to
Code:
(transcode = "LOD" OR transcode = "CSH") AND (BETWEEN(ttod((deyt)),start,ind))
I did a few steps here in one step, let's do that slower: The outer AND condition is one that would be applied to all ORed conditions. Just like you can expand (2+3)*4 to become (2*4+3*4):
Code:
transcode = "LOD" AND (BETWEEN(ttod((deyt)),start,ind)) OR transcode = "CSH" AND BETWEEN(ttod((deyt)),start,ind) AND (BETWEEN(ttod((deyt)),start,ind))
now the last AND condition2 is redundant.
Code:
transcode = "LOD" AND (BETWEEN(ttod((deyt)),start,ind)) OR transcode = "CSH" AND (BETWEEN(ttod((deyt)),start,ind))
And then you can see the same AND condition can be factored outside again:
Code:
(transcode = "LOD" OR transcode = "CSH") AND (BETWEEN(ttod((deyt)),start,ind))
Notice, that introduces the finally remaining paranthesis around the OR condition.
Finally, since the BETWEEN condition is only one condition, the paranetheses around that can be removed:
Code:
(transcode = "LOD" OR transcode = "CSH") AND BETWEEN(ttod((deyt)),start,ind)
So you end up with one of the overall conditions I suggested. Shortening the OR condition to an INLIST condition makes it simpler to add a new code.
It means your two step filter can be changed to what I suggested.
Chriss