Forum Replies Created

Viewing 15 posts - 4,891 through 4,905 (of 8,731 total)

  • RE: missing one record when selecting by date range

    itortu (5/26/2015)


    This did the trick for me:

    SELECT orderno

    FROM _order

    WHERE CAST(FLOOR(CAST(order_date AS FLOAT)) AS DATETIME)

    BETWEEN CAST('5/14/2015' AS DATETIME)

    AND CAST('5/15/2015' AS DATETIME)

    ORDER BY order_date asc

    The date will...

    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?

    I know while loops aren't bad even if they're used for data processing and not administrative tasks. That's why I wrote the article, to show how loops can be set-based...

    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: MYSQL ERROR 1160 error

    This is an SQL Server forum and you might not get help for MySQL. It's not that we're not willing to help, but most of us don't have experience 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: Advanced ranking function

    Thank you guys.

    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: Alter query to avoid hardcoding

    I'm not sure if this will be a good option because it might hit performance. However, it's a solution that might help.

    Maybe someone else could post a better option to...

    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 Replace function - without hardcoding

    Please don't post multiple threads for the same problem. You'll only divide the help you would receive and confuse people on the version that you're using.

    Further replies in here:

    http://www.sqlservercentral.com/Forums/Topic1688498-3077-1.aspx

    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 Cursor to display result in single transation

    From your example, you just need to get rid of the cursor. I'm sure that it would be more complicated than that, but the best option is if you share...

    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: Advanced ranking function

    This might be simpler to understand.

    WITH CTE AS(

    SELECT *, (ROW_NUMBER() OVER(PARTITION BY Country ORDER BY Id)+ 2) / 3 AS rowrank

    FROM #Countries

    )

    SELECT...

    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?

    Would someone be interested on helping me to proofread an article that I'm planning to submit to SQLServerCentral? It's about while loops not being evil. 😀

    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 SQL2008 view that conditionally counts rows with reset

    I hope that you understand it before implementing it.

    If you have any questions, feel free to ask them.

    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 SQL2008 view that conditionally counts rows with reset

    I'm sorry, something is going on with the forum which won't publish your posts immediately. I guess that it has to do with the spam filter and your posts might...

    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 SQL2008 view that conditionally counts rows with reset

    Can you post your sample data as Insert statements along with DDL for the table? For an easy way to do it, check this: http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/

    You could also start looking at...

    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?

    Steve Jones - SSC Editor (5/21/2015)


    It's nice having the kids get older. While I was on a call, my wife texted to ask if I could bring something to her...

    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 this possible in T-sql

    Jason,

    I find your solution overcomplicated. This was my original approach.

    --Using Jason's sample data

    SELECT Part,

    (ItemNumber + 1) / 2 AS SEQ,

    MAX( CASE WHEN...

    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 this possible in T-sql

    As mentioned, the splitter will split your column into separate values and will put one value in each row. You'll get your quantity on odd rows and price on even...

    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 - 4,891 through 4,905 (of 8,731 total)