Forum Replies Created

Viewing 15 posts - 766 through 780 (of 3,544 total)

  • RE: spliting data rowwise

    ;WITH cte (prefix,suffix,leftpart,rightpart,descrip) AS (

    SELECT CASE WHEN LEFT(range2,1) LIKE '[a-zA-Z]' THEN LEFT(range2,1) ELSE '' END,

    CASE WHEN RIGHT(range2,1) LIKE '[a-zA-Z]' THEN RIGHT(range2,1) ELSE '' END,

    LEFT(range2,CHARINDEX('-',range2)-1),

    SUBSTRING(range2,CHARINDEX('-',range2)+1,255),

    descrip

    FROM #temp),

    cte2 (prefix,suffix,startno,endno,descrip) AS (

    SELECT prefix,suffix,

    CAST(REPLACE(REPLACE(leftpart,prefix,''),suffix,'') as...

  • RE: Showing the same report layout but multiple times for different invoices

    Are you able to provide am example of the output as it is now and what you want it to look like?

    Obfuscate the data if it is sensitive.

  • RE: Select ID with the Greatest Rank

    caippers (4/29/2014)


    I apologize for that. I will ensure that I provide more info in the future.

    It was not intended as a criticism :blush:

    See links in Lynn's signature for information...

  • RE: Select ID with the Greatest Rank

    Yep Luis always gives good answers 😉

    Nice one Luis, especially from sparse details 😀

  • RE: Covert all characters in field into their ASCII code

    Eirikur Eiriksson (4/29/2014)


    What about Base36, almost closes the circle:-D

    FOTFL :w00t:

    Nice 😉

  • RE: Select ID with the Greatest Rank

    caippers (4/29/2014)


    Thanks for your post but when I tried this I only received the top 1 from the entire result set.

    That is what you asked for.

    What is the expect result...

  • RE: Select ID with the Greatest Rank

    Luis Cazares (4/29/2014)


    caippers (4/29/2014)


    ID is the PK in this table.

    If ID is the PK, why is it repeated? PKs should be unique.

    I noticed that but declined to comment on the...

  • RE: Covert all characters in field into their ASCII code

    Eirikur Eiriksson (4/29/2014)


    Probably a string of hex values would be better, at least every character representation is then of the same length.

    Meh! use octal 😛

  • RE: Select ID with the Greatest Rank

    SELECT TOP 1 ID

    FROM

    ORDER BY Rank ASC

    What about ties (ie two PK with the same Rank)

  • RE: SQL in a DMZ

    Sean Lange (4/29/2014)


    The more relevant question is why oh why do you have a sql instance in the DMZ???

    SSRS 😛

  • RE: Table two Column

    Sorry my bad it is incompatible data types, try converting to double or decimal

    =SUM(IIF(Fields!col3.Value = "DEL",CDbl(0),CDbl(Fields!col2.Value)))

    or

    =SUM(IIF(Fields!col3.Value = "DEL",CDec(0),CDec(Fields!col2.Value)))

  • RE: Table two Column

    Expression looks OK

    Check all the values in col2, looks like you have non integer value or NULL.

  • RE: Alternative to manual pivots

    What is generating the report?

  • RE: Null instead of 0

    Jeff Moden (4/12/2014)


    I know this is an old post and that the subject is controversial, but a blank means you know it is blank. NULL actually isn't a value....

  • RE: Table two Column

    Either change the sql query

    SELECT col1, CASE WHEN col3 = 'DEL' THEN 0 ELSE col2 END AS [col2], col3

    FROM

    Or use an expression for column 2

    =IIF(Fileds!col3.Value = "DEL",0,Fileds!col2.Value)

Viewing 15 posts - 766 through 780 (of 3,544 total)