Viewing 3 posts - 1 through 3 (of 3 total)
How about.
create function Shift(@Time datetime) as
return case when Hour([@Time]) beween 3 and 11 then 'B'
else when hour([@teim]) between 11 and 15 then 'L'
else 'D'
end
select Convert(DateTime,Convert(Varchar(50),Delivery_Date,101)) DelivDate,
, shift(Time_TargetDelivery)...
August 10, 2003 at 6:37 pm
Another possibility if the number of order by rows is small and predetermined
select * from
where selectColumn=@SelectValue
order by case when @SortParm='column1' then column1
when @SortParm='column2' then column2
when @SortPram='column3' then...
August 10, 2003 at 6:11 pm
Viewing 3 posts - 1 through 3 (of 3 total)