select Entry_Course,COUNT(*) as Str,DTSEN,DTCOM,Batch,dbo.getpdCount(ENTRY_course) as 'Att Pd',
dbo.getBTechBECount(ENTRY_course) as 'BTECH',dbo.getTESCount(ENTRY_Course) as 'TES',
dbo.getMedCount(ENTRY_course) as 'Med',
COUNT(*)-dbo.getBTechBECount(ENTRY_course)-dbo.getTESCount(ENTRY_course)AS [YO Str],
dbo.getYOCount(ENTRY_course) as 'YO Done',COUNT(*)-dbo.getBTechBECount(ENTRY_course)-dbo.getTESCount(ENTRY_course)-dbo.getyoCount(ENTRY_course) AS [Bal for YO],
dbo.getdtlCount(ENTRY_course) as 'Dtld YO',
CAST(dbo.getYOCount(ENTRY_course) AS INT) + CAST(dbo.getdtlCount(ENTRY_course) AS INT) AS 'Avl Deg'
FROM COURSE_INTAKE group by ENTRY_Course,DTCOM,DTSEN,batch