Exploding query text

C

cpnet

I have an app that's using DAO to automatically add some queries to an .mdb
database. The code all functions with no errors, but depending on how I
write my SQL Jet seems to rewrite the SQL sometimes creating a much, much
larger bit of SQL. (Or maybe it's Access that does this re-writing when I
open my .mdb in Access)? I'm concerned that this could cause some
performance issues. If not, I'm not going to worry about this, and I'll let
Jet re-write stuff however it wants.

Here's an example of 2 queries that my app is creating using DAO that do the
exact same thing:

SELECT c.YOSISID, c.DOB, c.GENDER, cp.*
FROM ClntPrgrm AS cp INNER JOIN Clnt AS c ON cp.CLNTID = c.CLNTID
WHERE ((((([RFRRLDTTM] Is Not Null) And ([ADMTDTTM] Is Not Null) And
([DSCHRGDTTM] Is Not Null)) And ((([RFRRLDTTM] Is Null) Or ([ADMTDTTM] Is
Null) Or ([RFRRLDTTM]<=[ADMTDTTM])) And (([RFRRLDTTM] Is Null) Or
([DSCHRGDTTM] Is Null) Or ([RFRRLDTTM]<=[DSCHRGDTTM])) And (([ADMTDTTM] Is
Null) Or ([DSCHRGDTTM] Is Null) Or ([ADMTDTTM]<=[DSCHRGDTTM]))) And
(((IIf([RFRRLDTTM] Is Null,[ADMTDTTM],[RFRRLDTTM])<DateSerial(2005,7,27)) Or
(([RFRRLDTTM] Is Null) And ([ADMTDTTM] Is Null))) And (([DSCHRGDTTM] Is
Null) Or ([DSCHRGDTTM]>=DateSerial(1990,4,26)))))=True))


SELECT c.YOSISID, c.DOB, c.GENDER, cp.*
FROM ClntPrgrm AS cp INNER JOIN Clnt AS c ON cp.CLNTID = c.CLNTID
WHERE (((([RFRRLDTTM] Is Not Null) And ([ADMTDTTM] Is Not Null) And
([DSCHRGDTTM] Is Not Null)) And ((([RFRRLDTTM] Is Null) Or ([ADMTDTTM] Is
Null) Or ([RFRRLDTTM]<=[ADMTDTTM])) And (([RFRRLDTTM] Is Null) Or
([DSCHRGDTTM] Is Null) Or ([RFRRLDTTM]<=[DSCHRGDTTM])) And (([ADMTDTTM] Is
Null) Or ([DSCHRGDTTM] Is Null) Or ([ADMTDTTM]<=[DSCHRGDTTM]))) And
(((IIf([RFRRLDTTM] Is Null,[ADMTDTTM],[RFRRLDTTM])<DateSerial(2005,7,27)) Or
(([RFRRLDTTM] Is Null) And ([ADMTDTTM] Is Null))) And (([DSCHRGDTTM] Is
Null) Or ([DSCHRGDTTM]>=DateSerial(1990,4,26))))))


Notice that the only difference is that the first version explicitly tests
that the whole WHERE clause resolves to "True". To me, the 2nd query is
more natural, because the 'true test' is redundant. When I view the .mdb
file in Access, I see that the SQL I created in the first query (with the
explicit 'True') remains the same. The 2nd query however ends up being
changed by Jet/Access to the huge query below. Will this huge query
hurt/help performance (I'd guess it will hurt performance, but maybe this is
some sort of weird optimization that actually helps)? (Both queries produce
the same result).


SELECT c.YOSISID, c.DOB, c.GENDER, cp.*
FROM ClntPrgrm AS cp INNER JOIN Clnt AS c ON cp.CLNTID = c.CLNTID
WHERE (((cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM)
Is Not Null) AND ((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null) AND
((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM) Is Not Null) AND ((cp.ADMTDTTM) Is Null And
(cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is
Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM) Is Not Null) AND ((cp.ADMTDTTM) Is Null And
(cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM)
Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Not Null) AND ((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Null And
(cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM)
Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM)
Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR
(((cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM)
Is Null And (cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM)
Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM) Is Not Null) AND ((cp.ADMTDTTM) Is Null And
(cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM)
Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM) Is Not Null) AND ((cp.ADMTDTTM) Is Not Null) AND
((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is
Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Not Null) AND ((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null) AND
((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is
Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM)
Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR
(((cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM)
Is Null And (cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM)
Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR
(((cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not
Null) AND ((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR
(((cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM)<=[DSCHRGDTTM] And
(cp.RFRRLDTTM) Is Not Null) AND ((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is
Not Null) AND ((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM)
Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR
(((cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM)
Is Null And (cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR
(((cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM)<=[DSCHRGDTTM] And
(cp.RFRRLDTTM) Is Not Null) AND ((cp.ADMTDTTM) Is Not Null) AND
((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND
((IIf([RFRRLDTTM] Is Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27)))
OR (((cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM) Is
Not Null) AND ((cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM) Is Not Null)
AND ((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM) Is Not Null) AND ((cp.ADMTDTTM) Is Null And
(cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM) Is Not Null) AND
((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM) Is Not Null) AND ((cp.ADMTDTTM)<=[DSCHRGDTTM] And
(cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM)
Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Not Null) AND ((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM)<=[DSCHRGDTTM] And
(cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM)
Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM) Is Not Null) AND
((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR
(((cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM) Is Not Null) AND
((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND
((IIf([RFRRLDTTM] Is Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27)))
OR (((cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM)<=[DSCHRGDTTM] And
(cp.RFRRLDTTM) Is Not Null) AND ((cp.ADMTDTTM)<=[DSCHRGDTTM] And
(cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND
((IIf([RFRRLDTTM] Is Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27)))
OR (((cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null) AND
((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM) Is
Not Null) AND ((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND ((IIf([RFRRLDTTM] Is
Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27))) OR
(((cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM)<=[DSCHRGDTTM] And
(cp.RFRRLDTTM) Is Not Null) AND ((cp.ADMTDTTM)<=[DSCHRGDTTM] And
(cp.ADMTDTTM) Is Not Null) AND ((cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26))) AND
((IIf([RFRRLDTTM] Is Null,[ADMTDTTM],[RFRRLDTTM]))<DateSerial(2005,7,27)))
OR (((cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM) Is
Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is Null And
(cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is
Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is Null And
(cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is
Null And (cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null And
(cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM)
Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is Null) AND
((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM) Is
Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM)
Is Null And (cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null And
(cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is
Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is Null And
(cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM)
Is Null) AND ((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null And
(cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM)
Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM) Is Not Null And
(cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not
Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Null And
(cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is Null And
(cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is
Null) AND ((cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM) Is Null) AND
((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM)
Is Null) AND ((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not Null And
(cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is
Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is Null And
(cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is
Not Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Null And
(cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM)
Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is
Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is Null And
(cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is
Null And (cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM)
Is Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is Not Null And
(cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is
Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM)<=[ADMTDTTM]
And (cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is Null) AND
((cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM)
Is Null And (cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM)
Is Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is Null And
(cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is
Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM)<=[DSCHRGDTTM]
And (cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is Null) AND
((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not
Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM)<=[DSCHRGDTTM] And
(cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is
Null And (cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM) Is Null) AND
((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is Null And
(cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null And
(cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM) Is
Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null And
(cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is Null And (cp.ADMTDTTM) Is Not
Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Null And
(cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM)<=[ADMTDTTM]
And (cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null And
(cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM) Is
Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM) Is Null And (cp.RFRRLDTTM) Is
Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM)<=[DSCHRGDTTM] And
(cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is
Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is Null And
(cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is
Null And (cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM) Is Not Null And
(cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM)
Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is
Null And (cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is Null) AND
((cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM)
Is Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM)
Is Null And (cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM) Is Not Null And
(cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Null And (cp.DSCHRGDTTM) Is
Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is Null And
(cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM) Is Not Null And (cp.RFRRLDTTM)
Is Null) AND ((cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM) Is Not Null And
(cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM)
Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM)<=[ADMTDTTM] And (cp.RFRRLDTTM) Is Not Null And
(cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM)
Is Not Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Null And
(cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM) Is Null And
(cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null And
(cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM)
Is Not Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR
(((cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null And
(cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM) Is Null And
(cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM) Is Not Null And (cp.ADMTDTTM)
Is Null) AND ((cp.DSCHRGDTTM) Is Not Null And ((cp.DSCHRGDTTM) Is Null Or
(cp.DSCHRGDTTM)>=DateSerial(1990,4,26)))) OR (((cp.RFRRLDTTM)<=[ADMTDTTM]
And (cp.RFRRLDTTM)<=[DSCHRGDTTM] And (cp.RFRRLDTTM) Is Not Null And
(cp.RFRRLDTTM) Is Null) AND ((cp.ADMTDTTM)<=[DSCHRGDTTM] And (cp.ADMTDTTM)
Is Not Null And (cp.ADMTDTTM) Is Null) AND ((cp.DSCHRGDTTM) Is Not Null And
((cp.DSCHRGDTTM) Is Null Or (cp.DSCHRGDTTM)>=DateSerial(1990,4,26))))
 
Top