Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access queries
Message
 
 
À
09/11/2005 03:05:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01066285
Message ID:
01066967
Vues:
16
>>>try this simple command, before:
>>>
>>>SELECT patient_name,count(DISTINCT Doctor_Name) as num from Visits
>>>
>>>
>>The same missing operator error. I'm using Access 2000. Looks like count(distinct ... ) is not allowed in Access database.
>
>If i remember good,
>the Access IDE it is very limited;
>a lot of queries that don't work, perfectly work if you send to the Jet Engine via ODBC.
>
>try this way :
>
>SELECT V.Patient_Name,V.Visit_Date,V.Doctor_Name,D.Doctor_Specialty
>FROM
>(SELECT Visits.Patient_Name,Visits.Visit_Date
>  FROM Doctors inner join Visits on Doctors.Doctor_Name = Visits.Doctor_Name
>	GROUP BY Visits.Patient_Name,Visits.Visit_Date
>	HAVING MIN(Visits.Doctor_Name)<>MAX(Visits.Doctor_Name)
>            AND MIN(Doctors.Doctor_Specialty)=MAX(Doctors.Doctor_Specialty)) X
>  INNER JOIN  Visits V ON X.Patient_Name=V.Patient_Name AND X.Visit_Date=V.Visit_Date
>  INNER JOIN  Doctors D ON D.Doctor_Name = V.Doctor_Name
>
>SELECT V.Patient_Name,V.Visit_Date,V.Doctor_Name,D.Doctor_Specialty
>FROM
>(SELECT Visits.Patient_Name,Visits.Visit_Date
>  FROM Doctors inner join Visits on Doctors.Doctor_Name = Visits.Doctor_Name
>	GROUP BY Visits.Patient_Name,Visits.Visit_Date
>	HAVING MIN(Visits.Doctor_Name)<>MAX(Visits.Doctor_Name)
>            AND MIN(Doctors.Doctor_Specialty)<>MAX(Doctors.Doctor_Specialty)) X
>  INNER JOIN  Visits V ON X.Patient_Name=V.Patient_Name AND X.Visit_Date=V.Visit_Date
>  INNER JOIN  Doctors D ON D.Doctor_Name = V.Doctor_Name
>
>
>I see a bad hour for you :)

Syntax error (missing operator).
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform