Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong with this query?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00587152
Message ID:
00587162
Vues:
25
Try
SELECT Person.lname, Person.totassignhrs, SUM(Pinfo.totcomphrs),;
  Person.failcmpldate;
 FROM  workprog!person INNER JOIN workprog!pinfo ;
   ON  Person.personid = Pinfo.personid;
 WHERE NOT (Person.compstatus == "COMPLETE");
  <b>HAVING</b> SUM(Pinfo.totcomphrs) = Person.totassignhrs
>I have a one to many table
>
>first table is call person (one)
>lastname
>totassignhrs
>compstatus
>
>second table is called pinfo (many)
>totcomphrs
>
>
>What I am trying to do is write a query where compstatus is not == "COMPLETE" and the sum of totcomphrs (from many table) equals totassignhrs.
>
>The following query give me syntax error saying sum.prg does not exist:
>
>SELECT Person.lname, Person.totassignhrs, SUM(Pinfo.totcomphrs),;
> Person.failcmpldate;
> FROM workprog!person INNER JOIN workprog!pinfo ;
> ON Person.personid = Pinfo.personid;
> WHERE NOT (Person.compstatus == "COMPLETE");
> AND SUM(Pinfo.totcomphrs) = Person.totassignhrs
>
>I'm I writing this query wrong or is there another way to write this.
>
>Thanks
>Nick Patel
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform