Hello,
Why is it that this query is OK:
SELECT *
FROM DATABASE
WHERE (
Child1DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child2DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child3DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child4DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child5DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child6DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
ChkUnborn="Yes"
);
But this query (I added the NOT) give a error Invalid Procedure Call:
SELECT *
FROM DATABASE
WHERE NOT (
Child1DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child2DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child3DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child4DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child5DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child6DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
ChkUnborn="Yes"
);
It is to do with the ChkUnborn="Yes" - if I remove that the second query with the not runs ok.
Help.
Thanks
Al
Why is it that this query is OK:
SELECT *
FROM DATABASE
WHERE (
Child1DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child2DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child3DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child4DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child5DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child6DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
ChkUnborn="Yes"
);
But this query (I added the NOT) give a error Invalid Procedure Call:
SELECT *
FROM DATABASE
WHERE NOT (
Child1DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child2DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child3DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child4DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child5DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
Child6DOB Between DateStart And DateAdd("yyyy",-6,DateStart) OR
ChkUnborn="Yes"
);
It is to do with the ChkUnborn="Yes" - if I remove that the second query with the not runs ok.
Help.
Thanks
Al