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

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Issue with String concatenation need help please

    Have you tried it?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: unpivot dynamic columns

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

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Need a 2nd opinion on a query

    And that's the original query.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: select query

    Note that this thread is almost 4 years old.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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)

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

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