inlist UDF * Val Ord 110 1 89 2 10 3 ... JOIN dbo.inlist(@tcDeptList) il ON il.val = dbo.meetings.RoomID ORDER BY dbo.coRooms.deptdisplayorder, il.ord, dbo.meetings.begintime>Tricky order by clause question. In the snippit of code below, I use a inlist function to determine if a roomID is in the passed list of rooms for selection purposes.
>and dbo.meetings.RoomID in (select val from dbo.inlist(@tcDeptList)) >ORDER BY dbo.coRooms.deptdisplayorder,dbo.coRooms.RoomName, dbo.meetings.begintime >>
>110,110,89,10 >>