Forum Replies Created

Viewing 15 posts - 5,326 through 5,340 (of 8,731 total)

  • RE: Transpose/Pivot textual data

    As I said, using MAX() will help you with this problem. I hope that you can get rid of this EAV design which makes everything more complicated.

    Here's an example of...

    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: Transpose/Pivot textual data

    Yes, it can be done using MAX() and probably a ROW_NUMBER() to prevent aggregation.

    If you post the sample data, I can show you how to do 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: what else can you search for instead of col1 = '' or col1 = ' ' or col1 is null?

    TheSQLGuru (1/16/2015)


    Where ltrim(rtrim(col1)) = ''

    I see this code ALL THE TIME at clients. Can someone tell me why both would be needed?? 😎

    It's not needed.

    It's probably a misconception coming...

    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: How to get a consecutive count based on the first value

    Yes and no.

    I declare the variable like that but it could be any date to get historic reports. I believe that I tested it with a simple GETDATE().

    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 Query

    I got confused with your explanation. Could you post DDL and sample data (as insert statements) along with expected results based on that sample data?

    That will give you better and...

    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: Are the posted questions getting worse?

    Brandie Tarvin (1/15/2015)


    Sean Lange (1/15/2015)


    I am having a discussion with somebody who swears that using

    EXISTS(select 1

    is way faster than just select *. I know Gail has an article on...

    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 data from another database without reference

    Have you checked the Synonyms?

    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: Urgent! Need help on query!

    You need to split the data in your Value column. If possible, normalize the table so you don't have to work like that.

    To split the data, you could use the...

    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: Are the posted questions getting worse?

    Brandie Tarvin (1/14/2015)


    Koen Verbeeck (1/14/2015)


    Luis Cazares (1/14/2015)


    Congratulations Koen! When I grow up I want to be like you. :hehe:

    Action figures will soon be available! 😎

    With or without superhero capes?

    Edna Mode


    No...

    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: If Else logic

    Use the variabale in the WHERE clause.

    select *

    from @t

    where IsSalaryApproved = @IsSalaryApproved

    EDIT: Sorry, I need more coffee to read carefully.

    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: Are the posted questions getting worse?

    Congratulations Koen! When I grow up I want to be like you. :hehe:

    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: Pass date format into Stored Proc

    I would suggest you to follow Sean's advice. You have a simple front end available called Reporting Services (SSRS).

    It's a powerful tool that you could use to prevent this kind...

    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: How to get a consecutive count based on the first value

    Even if it's readable, I wouldn't suggest using Stephanie's code. It reads the table 7 times which can become a nightmare on large tables.

    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: How to get a consecutive count based on the first value

    Hi, here's one possibility to get that report. There are other possibilities but this just seemed easy for me.

    SELECT CustomerID,

    DATEDIFF( MM,

    ...

    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: Pass date format into Stored Proc

    So the problem was when calling the stored procedure.

    If you corrected your app code, you shouldn't have changed your stored procedure.

    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 - 5,326 through 5,340 (of 8,731 total)