|
tanu
Yak Posting Veteran
57 Posts |
Posted - 2008-06-25 : 17:21:41
|
| Hi,I have this college list. I need two records appearing on the same line if their textterm,department,course and section matches.Then there would be three more columns Offerday2, TimeFrom2, Time2.If term,department,course,section are same we see like this now Term Department course section Title offerday starttime endtime FAll08 a 1 2 ch MWF 8:00 AM 8:50 AM FAll08 a 1 2 ch T 1:00 PM 3:30 PMBut we want something like thisTerm Department course section Title offerday starttime endtime offerday2 Starttime2 endtimeFAll08 a 1 2 ch MWF 8:00 AM 8:50 AM T 1:00 pm 3:30 pmSelect TextTerm,Department,Course, Section, Coursename as Title,Credits,OfferDays, TimeFrom = (Select case when offerdays = ' ' then 'N/A' Else left(STUFF(right(CONVERT(varchar(50), offertimefrom, 109), 14), 9, 4, ' '),5)+' '+ right(STUFF(right(CONVERT(varchar(50), offertimefrom, 109), 14), 9, 4, ' '),2) End) , TimeTo = (Select case when offerdays = ' ' then 'N/A' Else left(STUFF(right(CONVERT(varchar(50), offertimeTo, 109), 14), 9, 4, ' '),5)+' '+ right(STUFF(right(CONVERT(varchar(50), offertimeTo, 109), 14), 9, 4, ' '),2) End), convert(varchar(10),StartDate,101)as StartDate, convert(varchar(10),EndDate,101) as EndDate, FacultyFirstName+' '+FacultyLastName as Instructor, MaximumEnroll as Limit, CurrentEnroll as Enrolled, RoomAbbreviation, RoomNumber,AccessCampus,Status from Viewwhere TextTerm ='Fall08' and MaximumEnroll > CurrentEnroll |
|