This query gives me syntax error in when-between line. how can i solve them?
alter FUNCTION [dbo].[fn_GetActivityLogsArranger]
(
@time AS nvarchar(max)
)
RETURNS nvarchar(max)
AS
BEGIN
declare @Return varchar(30)
select @Return = case @time
when between '15:00' and '15:30' then '15:00-15:30'
when between '15:30' and '16:00' then '15:30-16:00'
when between '16:00' and '16:30' then '16:00-16:30'
when between '16:00' and '16:30' then '16:00-16:30'
when between '16:30' and '17:00' then '16:30-17:00'
when between '17:00' and '17:30' then '17:00-17:30'
when between '17:30' and '18:00' then '17:30-18:00'
else 'Unknown'
Return @Return
end