Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very embarassing - Access query
Message
From
01/11/2005 17:48:47
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01063741
Message ID:
01064282
Views:
15
>We finally had a chance to work with my colleague. We do want only patients with the 2 visits on the same date. So, the original inner select was correct.
>
>Here is the query that works:
>
>select V.patient_name, V.visit_date, V.doctor_name, DOCTORS.doctor_specialty
>
>from Visits V INNER JOIN DOCTORS ON V.doctor_name=DOCTORS.doctor_name
>
>WHERE EXISTS(SELECT patient_name, visit_date FROM Visits
>
>                    WHERE patient_name=V.patient_name
>
>                      AND visit_date=V.visit_date
>
>group by patient_name, visit_date
>
>having count(VISITS.visit_date)>1
>
>)
>
>
However it is horrible
Previous
Reply
Map
View

Click here to load this message in the networking platform