Forum Replies Created

Viewing 15 posts - 5,266 through 5,280 (of 8,731 total)

  • RE: pivot?!?

    For an explanation on what Phil posted.

    http://www.sqlservercentral.com/articles/comma+separated+list/71700/

    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 am I missing?

    DaveK2014 (2/3/2015)


    So using your first two lines which are the same as mine I am getting a Invalid length parameter passed to the right function.

    After adding another possibility, I found...

    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 am I missing?

    I don't get any error, I'm not sure if I was supposed to get one.

    Here's my test along with alternative methods.

    WITH SampleData AS(

    SELECT 'Luis Cazares' AS...

    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: Date Range Calculation Challenge

    Have you considered using a calendar table to join with the date ranges and use COUNT() grouping by account, location and month? Do you need an example?

    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: Date Range Formula

    To get dynamic calculations on dates, you can use the DATEADD() function.

    Remember that when using BETWEEN, the lower value goes first or you'll get a non-valid range with no error...

    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: Curious interview question

    That's good to know. As I'm basically a developer, I'm not used to work on admin tasks.

    Thank you, Lowell.

    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: Is it possible to embed a parameter in the name of stored procedure that's called from within another sproc?

    pharmkittie (1/29/2015)


    Luis Cazares: Hey, we all have to start somewhere. What would you suggest as the better way? Thanks.

    dwain.c and mister magoo: Thank you! I will try...

    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: Dividing a number with remainders

    asm1212 (1/30/2015)


    Luis, or someone else, I am a fellow DBA but I have not seen this before! If it is not too much to ask, can you just kind 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: Is it possible to embed a parameter in the name of stored procedure that's called from within another sproc?

    Are you seriously creating the same stored procedures for each quarter? I don't want to imagine what would happen if you need a daily report.

    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: Dividing a number with remainders

    Just to give both options together to compare them. The first version including all the remainder in the first month and the second version putting an extra cent per month.

    ALTER...

    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: Dividing a number with remainders

    Maybe something like this. If you change/remove the third parameter of round() you'll get different results. This will always return the first payment equal or greater than all the other...

    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: Function with 2nd part working on results 1st part

    SpeedSkaterFan (1/29/2015)


    Luis, Sorry for not replying to your thread yesterday.

    Timedifferences between the Netherlands and Mexico ...

    That's totally understandable, don't worry.

    SpeedSkaterFan (1/29/2015)


    Anyway: the results of your code looks to be exactly...

    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: Concatenating multiple rows(certain columns)

    Tweaking Alan's code, I can reduce the reads by half by reducing the length of the code. 🙂

    WITH uqvals AS

    (

    SELECT ID,

    MIN(DateOpen) DateOpen,

    ...

    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: Concatenating multiple rows(certain columns)

    This article will help you to obtain the desired result.

    http://www.sqlservercentral.com/articles/comma+separated+list/71700/

    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 Result set explanation needed

    It's because your varchar column is being implicitly converted to a numeric(4,0) as stated on the data type precedences. SQL Server does implicit conversions because it can't compare apples 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

Viewing 15 posts - 5,266 through 5,280 (of 8,731 total)