Forum Replies Created

Viewing 15 posts - 1,621 through 1,635 (of 8,731 total)

  • RE: Query with multiple conditions (SQL 2016)

    You need to understand what you're doing with your GROUP BY clause. If you don't have the correct columns or expressions, you'll never arrive to the expected results.
    [code...

    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 with multiple conditions (SQL 2016)

    Seems pretty clear:
    You cannot use an aggregate in an expression used for the group by list of a GROUP BY clause.
    Maybe you're trying to get the functionality...

    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: Today's Random Word!

    Ed Wagner - Wednesday, January 25, 2017 1:27 PM

    ZZartin - Wednesday, January 25, 2017 12:29 PM

    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 SYNTAX HELP PLEASE - Easy question if you can

    mw112009 - Wednesday, January 25, 2017 12:30 PM

    Luis Cazares - Wednesday, January 25, 2017 12:24 PM

    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 converting data type nvarchar to numeric

    Is Form.ID an nvarchar column or a numeric? If it's a numeric, why are you using nvarchar for the parameter?
    The values in Qty.primaryanswer and WC.primaryanswer include the braquets? Or...

    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 statement in Dataset query

    You really don't want a multi statement table valued function. You want to use an inline table valued function. The difference would be huge in performance, over 200 times faster...

    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 SYNTAX HELP PLEASE - Easy question if you can

    Even better, make sure that you only have numbers.

    SELECT
      bestphone = CASE
          WHEN MemberHomePhoneNbr LIKE REPLICATE('[0-9]',10) THEN MemberHomePhoneNbr
          WHEN AlternatePhone LIKE...

    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: Today's Random Word!

    djj - Tuesday, January 24, 2017 1:01 PM

    Ed Wagner - Tuesday, January 24, 2017 12:46 PM

    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: Dynamic SQL Help needed: Why doesn't this work?

    craig.bobchin - Tuesday, January 24, 2017 10:52 AM

    Luis Cazares - Tuesday, January 24, 2017 10:41 AM

    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: Dynamic SQL Help needed: Why doesn't this work?

    I would take a shortcut for the tables and get the information that is already stored in SQL Server. Then I would just need to count the rows in 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: TSQL - Aggregate Bitwise

    drew.allen - Monday, January 23, 2017 12:58 PM

    The problem with using the quirky update is that it's, well, quirky.  It's not guaranteed...

    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: right aligning

    David Conn - Tuesday, January 24, 2017 3:04 AM

    BillLudlow - Tuesday, January 24, 2017 12:45 AM

    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 NULL then Zero (0)

    To simplify even more:

    SELECT
      ActiveProd   = COUNT( CASE WHEN StatusID = 1 THEN ProdID END),
      InactiveProd  = COUNT( CASE WHEN StatusID = 2...

    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: Converting Stored Procedure to Function

    You need to be aware of the implications. Changing a stored procedure into a function might not work because functions are meant to return something (scalar value or table) while...

    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: SSC Forum Updates

    Thom A - Monday, January 23, 2017 4:41 AM

    Brandie Tarvin - Monday, January 23, 2017 4:28 AM

    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 - 1,621 through 1,635 (of 8,731 total)