Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's wrong with this SQL?
Message
From
23/03/2004 08:45:34
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
What's wrong with this SQL?
Miscellaneous
Thread ID:
00888825
Message ID:
00888825
Views:
40
Hi,
What wrong with this sql? It works in command window, but cause error "SQL column 'iiD' is not found" from view designer and dataenvironment.
SELECT Patient_treatments.memcode, Patient_treatments.iid,;
  Patient_treatments.itreatid, Patient_treatments.ddatetime,;
  Patient_treatments.nqty, Patient_treatments.yprice,;
  Patient_treatments.ncount, Treatments.ccode, Treatments.cdesc,;
  SUM( Consultancydetails.iqty) AS nUsed;
 FROM  physician!treatments INNER JOIN physician!patient_treatments;
    INNER JOIN physician!consultancydetails;
    INNER JOIN membership!member;
    RIGHT OUTER JOIN physician!consultancydetails ;
   ON  Consultancydetails.itreatid = Patient_treatments.iid ;
   ON  Patient_treatments.memcode = Member.card_no ;
   ON  Treatments.iid = Consultancydetails.itreatid ;
   ON  Treatments.iid = Patient_treatments.itreatid;
 WHERE Member.card_no = ?vp_memcode;
 GROUP BY Patient_treatments.iid, Patient_treatments.memcode,;
  Patient_treatments.itreatid, Patient_treatments.ddatetime,;
  Patient_treatments.nqty, Patient_treatments.yprice,;
  Patient_treatments.ncount
 HAVING nUsed < Patient_Treatments.nCount
Please advise
Thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Next
Reply
Map
View

Click here to load this message in the networking platform