Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ggardei
Starting Member
6 Posts |
Posted - 2010-05-17 : 11:34:59
|
| Greetings,I wrote a query that lists all the assignment categories in a give class and what the weight of each category is...SELECT glossary.displaytext AS Category, CategoryWeight, AssignmentCategoryID as SRCourseTestAssignCatIDFROM dbo.SRCourseTestAssignCat JOIN glossary ON dbo.SRCourseTestAssignCat.AssignmentCategoryID = dbo.Glossary.UniqueIdWHERE SROfferID = 7491which returns the results of:Category CategoryWeight SRCourseTestAssignCatIDTests 35 2995Reading 30 2997Papers 30 2991Project 5 2990I want to exclude any of the categories that do not have graded assignments . I wrote this query...SELECT AssignmentCategoryID as SRCourseTestAssignCatIDFROM dbo.SRCourseTestAssignCat WHERE SROfferID = 7491INTERSECTSELECT DISTINCT SRCourseTestAssignCatID FROM SRCourseGrade JOIN dbo.SRCourseTest ON dbo.SRCourseTest.SRCourseTestID = SRCourseGrade.SRCourseTestIDWHERE SROfferID = 7491 which returns299129952997Now, I need to figure out how to get the category name and weight. I have not been able to figure this one out. Any help!I want the following resultsTests 35 2995Reading 30 2997Papers 30 2991George W. GardeiGod's Bible School & College(513) 763-65161810 Young StreetCincinnati, OH. 45202 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-05-17 : 11:46:38
|
| [code]SELECT glossary.displaytext AS Category, CategoryWeight,AssignmentCategoryID as SRCourseTestAssignCatIDFROM dbo.SRCourseTestAssignCat JOIN glossary ON dbo.SRCourseTestAssignCat.AssignmentCategoryID = dbo.Glossary.UniqueIdWHERE SROfferID = 7491AND AssignmentCategoryID IN (SELECT AssignmentCategoryID as SRCourseTestAssignCatIDFROM dbo.SRCourseTestAssignCat WHERE SROfferID = 7491INTERSECTSELECT DISTINCT SRCourseTestAssignCatID FROM SRCourseGradeJOIN dbo.SRCourseTest ON dbo.SRCourseTest.SRCourseTestID = SRCourseGrade.SRCourseTestIDWHERE SROfferID = 7491 )[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
ggardei
Starting Member
6 Posts |
Posted - 2010-05-17 : 13:18:51
|
| Thank you very much!!! this is close to what I came up with. I will compare to see what I did wrong.George W. GardeiGod's Bible School & College(513) 763-65161810 Young StreetCincinnati, OH. 45202 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-05-18 : 01:10:01
|
| welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|