Forum Replies Created

Viewing 15 posts - 7,381 through 7,395 (of 8,731 total)

  • RE: Are the posted questions getting worse?

    Congratulations Gail, thank you for all the shared knowledge.:-D

  • RE: Split out FirstName, LastName, MiddleName

    Something like this?

    WITH CTE([MemberName])AS(

    SELECT 'Cazares, Luis' UNION ALL

    SELECT 'Cazares, Luis A')

    SELECT LEFT( MemberName, CHARINDEX(',', MemberName) - 1) LastName,

    SUBSTRING( MemberName, CHARINDEX(',', MemberName) + 1, LEN( MemberName)) FirstName

    FROM CTE

  • RE: Issue with String concatenation need help please

    Have you tried it?

  • RE: Issue with String concatenation need help please

    Example:

    IIF ( [ES Fully approved data 1] = '', '', [ES Fully approved data 1] + ';') +

    IIF ( [ES Fully approved data 2] = '', '', [ES Fully...

  • RE: unpivot dynamic columns

    Could you post DDL and sample data on the way of INSERT statements so we can work directly on it?

  • RE: Error while executing a function

    This should do the trick, however, I can't assure you that because I have nothing to test on.

    Be aware that you can't use ORDER BY in a TVF because it...

  • RE: Error while executing a function

    You have a declaration for a single statement table valued function but your function has multiple statements.

    Maybe I can help you with the code but it would be easier with...

  • RE: SQL code

    DATEADD(mm, DATEDIFF(mm, 0, GETDATE()) - 1, 0)

    Is getting the first day of previous month.

    DATEADD(mm, DATEDIFF(mm, 0, GETDATE()), 0)

    Is getting the first day of current month.

    - '00:00:01'

    Is substracting one second...

  • RE: Condition in a Where clause?

    Actually you can use a variable inside IN if it is called from SSRS. The variable is replaced in the query before submitting it to SQL Server.

    My knowledge in SSRS...

  • RE: Condition in a Where clause?

    You can't use a variable with a comma-separated values string to be evaluated with IN().

    You could as well try the Delimited String Splitter[/url].

    Read the article and if you have any...

  • RE: INSERTION

    To build one set as John said:

    DROP TABLE #TableA

    CREATE TABlE #TableA

    (

    ID INT,

    SourceData nvarchar(MAX)

    )

    INSERT INTO #TableA

    VALUES(1, 'INSERT TableX VALUES( 1''Something'')'),

    (2, 'INSERT TableY VALUES( ''Something Else'', 1)'),

    (3, 'INSERT TableX VALUES( ''Something...

  • RE: Query approach

    It's a great thing that you found an answer that will perform correctly and will be fast and simple to understand and an answer that will help you to learn...

  • RE: Need a 2nd opinion on a query

    And that's the original query.

  • RE: select query

    Note that this thread is almost 4 years old.

  • RE: Query approach

    This might do the trick as well.

    SELECT DISTINCT IPCode, ID

    FROM Profile p

    WHERE EXISTS( SELECT IPCode

    FROM Profile x

    WHERE p.IPCode = x.IPCode

    GROUP BY IPCode HAVING COUNT( DISTINCT ID) > 1)

Viewing 15 posts - 7,381 through 7,395 (of 8,731 total)