Gary, Mark ---
Don't know if this will do it, but it may be just a matter of parentheses. How about this ...
SELECT AllThatStuff ;
FROM AllThoseTables ;
WHERE Programs.cprogramcode = Programcode.cprogramcode;
AND Programs.nclientno = Clients.nclientno;
AND Programs.creferralcode = Referralcode.creferralcode;
AND Programs.cstaff1 = Staff.cstaffcode;
AND Programs.ndischargetype = Dischargetype.ndischargetypeid;
AND (Programs.cstaff2 = Staff_a.cstaffcode;
OR Programs.cstaff2 = "")
Not that the parentheses are different than the way you had them originally ... don't know how much difference it'll make, but give it a try.
~Bonnie
>Hi Mark
>
>Thank you very much for your reply.
>
>The following is my SQL statement in its entirety:
>
>SELECT Programs.cprogramcode, Programcode.cdescription,;
> Programs.nclientno, Clients.cfirstname, Clients.cmiddlename,;
> Clients.clastname, Programs.creferralcode, Referralcode.cdescription,;
> Programs.ndischargetype, Programs.cstaff1, Staff.cfirstname,;
> Staff.clastname, Programs.cstaff2, Staff_a.cfirstname, Staff_a.clastname,;
> Programs.nprogramid, Programs.ddischarge, Programs.dadmission,;
> Programs.lreferedout, Programs.lmedicalcare, Programcode.ddateofentry,;
> Dischargetype.cdischargetype;
> FROM parenting!programcode, parenting!clients,;
> parenting!referralcode, parenting!staff, parenting!staff Staff_a,;
> parenting!programs, parenting!dischargetype;
> WHERE Programs.cprogramcode = Programcode.cprogramcode;
> AND Programs.nclientno = Clients.nclientno;
> AND Programs.creferralcode = Referralcode.creferralcode;
> AND Programs.cstaff1 = Staff.cstaffcode;
> AND Programs.ndischargetype = Dischargetype.ndischargetypeid;
> AND Programs.cstaff2 = Staff_a.cstaffcode;
> OR (Programs.cstaff2 = "")
>
>The difference between this one and the one I E-mail about originally is that there is no check to see if (Programs.cstaff2 LIKE "%").
>
>When I run the SQL, I get the same record repeated over and over again in the browse window. I was hoping to get back just one record regardless of weather
>or not there is a value in Programs.cstaff2.
>
>Thank You
>
>Gary Hagerty