i have a web page in asp.net+vb code+sql database. in an table named course_intake i want to count i tried some and it works correct but i am not able to add more clouse to it
1. if date1 (field) not equal to date2 (field) then att pd as 1 else 2
2. (OY is a field) if OY Ends is lesser than Jun then Deg Dt as 1 Jul+ OY end year (example if OY is 5 Jun 2012 then deg dt will be 1 Jul 12 else 1 Dec 12)
3. ount from COURSE_INTAKE where OY LIKE 'YO-' WHERE ENTRY_COURSE= ENTRY_COURSE
4. count from COURSE_INTAKE where OY LIKE 'TAKEN YO-' WHERE ENTRY_COURSE= ENTRY_COURSE
5. ount from COURSE_INTAKE where OY LIKE 'DONE' WHERE ENTRY_COURSE= ENTRY_COURSE
my code is as under
select ENTRY_course,COUNT(*) as Str,convert (varchar, DTsen,6) as [DTSEN],convert (varchar, DTCOM,6) as [DTCOM],
dbo.getBTechBECount(ENTRY_course) as 'BTECH',batch,dbo.getMedCount(ENTRY_course) as 'MED',convert (varchar,
DTCOM+396,6) as [AVL for OY], str-btech AS [STR AVL]
FROM COURSE_INTAKE group by ENTRY_course,DTCOM,dtsen,batch, str-btech ORDER BY dtcom