General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only