Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More questions about views
Message
From
29/12/1999 12:41:23
 
 
To
29/12/1999 10:10:44
General information
Forum:
Visual FoxPro
Category:
Visual FoxExpress
Miscellaneous
Thread ID:
00309797
Message ID:
00309933
Views:
27
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
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform