Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Count
Message
From
21/03/2000 13:54:45
 
 
To
21/03/2000 13:13:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: Count
Miscellaneous
Thread ID:
00348469
Message ID:
00348517
Views:
26
Thanks alot David. That got all of my quantities correct. Now when I print the report how do I get the quantity to show up for the correct course? Here is my new code if that will help.

select course.courseid, count(assignment.courseid) as qty;
from course left join assignment on course.courseid = assignment.courseid;
into cursor classi;
group by course.courseid
qty = alltrim(str(classi.qty))


select course.courseid, count(assignment.courseid) as qty2;
from course left join assignment on course.courseid = assignment.courseid;
where (assignment.description LIKE '%TEST%';
OR assignment.description LIKE '%QUIZ%';
OR assignment.description LIKE '%EXAM%';
OR assignment.description LIKE '%MIDTERM%');
into cursor ccrequest;
group by course.courseid


select course.courseid, count(assignment.courseid) as qty3;
from course left join assignment on course.courseid = assignment.courseid;
where assignment.description NOT LIKE '%TEST%';
AND assignment.description NOT LIKE '%QUIZ%';
AND assignment.description NOT LIKE '%EXAM%';
AND assignment.description NOT LIKE '%MIDTERM%';
into cursor whatever;
group by course.courseid
qty3 = alltrim(str(whatever.qty3))


select course.courseid, course.name, nvl(material.materialid, "None ") as materialid,;
nvl(material.description, "None ") as mname;
from course left join cmaterials on course.courseid = cmaterials.courseid;
left join material on cmaterials.materialid = material.materialid;
UNION select course.courseid, course.name, nvl(textbook.textid, "None ") as materialid,;
nvl(textbook.textname, "None ") as mname;
from course left join coursematerial on course.courseid = coursematerial.courseid;
left join textbook on coursematerial.textid = textbook.textid;
into cursor clmaterial


The nested iif statement is the same. I group the report by courseid from the clmaterial cursor.

Tyler
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform