Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong with this query?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00587152
Message ID:
00587162
Views:
24
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform