Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)

  • RE: List Count

    declare @mylist nvarchar(100), @delimiter VARCHAR(2)

    set @mylist = 'A,B, C, D , 1, 2,345, EFG, H, '

    set @delimiter = ','

    select@mylist list,

    (LEN(@mylist) - LEN(replace(@mylist,@delimiter,'')))/LEN(@delimiter)

    +

    case when right(rtrim(LTRIM(@mylist)),1) = @delimiter then 0 else 1...

  • RE: Find Last Day of the Month

    Yet another way to get last day of the month

    Select DATEADD (mm, DATEDIFF (mm, 0, getdate ()) +1,-1)

  • RE: Extend CHARINDEX with occurance matching

    To get the number of times a particular string occurs in another string

    DECLARE @STR VARCHAR(100) = 'ABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE'

    DECLARE @SEARCH VARCHAR(10) = 'A'

    -- TO GET THE NUMBER OF OCCURRENCE COUNT

    SELECT...

Viewing 3 posts - 1 through 3 (of 3 total)