• Sth is wrong... im getting still only first date hmm

    alter procedure [dbo].[test]@multiple_weeks varchar(8)

    as

    declare

    @val date

    create table #ps(id varchar(30),week varchar(8)[...])

    declare c1 cursor for

    select CONVERT(varchar,Item,112) FROM [dbo].[DelimitedSplit8K](@multiple_weeks ,',') Myfn

    open c1

    fetch next from c1 into @val

    While @@fetch_status <> -1

    begin

    insert into #ps id,,CONVERT(varchar,@val,112), [...]

    fetch next from c1 into @val

    end

    close c1

    deallocate c1

    select [...]

    from

    (select[...]) d

    Where may I be wrong in such schema?