0
Hi,
Try this query :
select cmn_minor_code as Course_Name, convert(char,cbm_batch_start_dt,106) as Course_date, cbm_batch_id as Batch_ID, count(*) as No_of_students
from student s,course_registration cr,batch_course_registration bcr,co_batch_master cbm
where cr.stud_id = s.stud_id
and cr.cr_bill_no = bcr.cr_bill_no
and bcr.bcr_batch_id = cbm.cbm_batch_id
and cbm.cbm_active <> 'D'
and cr.cr_active = 'A'
and s.stud_active <>'D'
and cbm_batch_id = 'B8753'
and cbm.cbm_active < 'd'
and cbm.cbm_batch_start_dt between convert(datetime,'06-Jul-2015',6) and convert(datetime,'06-Jul-2015',6)
group By cbm.cmn_minor_code, convert(char,cbm.cbm_batch_start_dt,106), cbm.cbm_batch_id
order by cbm_batch_start_dt