Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

How to list total credit hours in sql

$
0
0

Hello,

I am trying to build a report which includes student no, student name,course code, yr code, term code, hrs_earned and total credit hours. So I want total credit hours every year wise of total subject. It is top of my head. But I didn't get any idea right now.. I am trying to build a transcript but yr_cde wise...I am also attaching a format here

Other option I am thinking about to build a report which includes summation of credit hours course code wise..

select stsd.ID_NUM,
nm.FIRST_NAME+' '+nm.LAST_NAME as 'Name',
stsd.YR_CDE,
stsd.TRM_CDE,
sch.CRS_CDE,
sch.GRADE_CDE,
sch.CREDIT_HRS,
sch.HRS_EARNED,
(
SELECT sum(sch1.HRS_EARNED)
FROM STUDENT_CRS_HIST sch1
WHERE sch1.YR_CDE = stsd.YR_CDE
AND sch1.TRM_CDE = stsd.TRM_CDE
AND sch1.ID_NUM = stsd.ID_NUM
) AS [Total Hrs_Earned]
from STUD_TERM_SUM_DIV stsd
left outer join...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>