Forum Replies Created

Viewing 15 posts - 2,806 through 2,820 (of 8,731 total)

  • RE: How to find postcodes with two spaces in the middle?

    Probably this could help. The problem is that you have a char(10) and you're looking for 8-character strings.

    SELECT *

    FROM dbo.Postcode

    WHERE p_code LIKE N'___ ___ ';

    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 (5/26/2016)


    BWFC (5/26/2016)


    Brandie Tarvin (5/25/2016)


    Brandie Tarvin (5/25/2016)


    <singing>

    All the lonely servers. Where do they all come from? All the lonely servers... Where doooo they allllllllllllllllll come from?

    Sigh. Wish wish wish...

    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?

    Gazareth (5/25/2016)


    jasona.work (5/25/2016)


    Eirikur Eiriksson (5/25/2016)


    Brandie Tarvin (5/25/2016)


    Brandie Tarvin (5/25/2016)


    <singing>

    All the lonely servers. Where do they all come from? All the lonely servers... Where doooo they allllllllllllllllll come from?

    Sigh. Wish wish...

    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: "Duplicate" records - How to coalesce?

    Use a "self" join. In other words, join the table to itself.

    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!

    ThomasRushton (5/25/2016)


    Ed Wagner (5/25/2016)


    Manic Star (5/25/2016)


    Hugo Kornelis (5/25/2016)


    Grumpy DBA (5/25/2016)


    ThomasRushton (5/25/2016)


    pain

    Joy and

    Heaven and

    Chocolate Sprinkles

    Ice Cream

    Cake!

    Birthday

    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!

    Manic Star (5/24/2016)


    crookj (5/24/2016)


    HappyGeek (5/24/2016)


    Manic Star (5/24/2016)


    Grumpy DBA (5/24/2016)


    Manic Star (5/24/2016)


    Ray K (5/24/2016)


    Ed Wagner (5/24/2016)


    crookj (5/24/2016)


    Rift

    Continuum

    Vacuum

    Cleaner

    Winston Wolfe

    Mystery

    Writer

    Ghost

    Buster

    Bunny

    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: Pivot help

    I understand that you want that format. But the image you posted, has more data that the sample data you posted. I have no idea of what the numbers should...

    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: Pivot help

    That doesn't reflect the sample data you posted.

    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: Pivot help

    ziggy2016 (5/24/2016)


    Many thanks to you and others who have contributed sofar. In the Month column, it displays avg but what I want is the percentages like 90% and so 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: Date Calculation Project

    This is what I use for "previous row" calculations on 2008. For 2012+, I would use LAG.

    WITH CTE AS(

    select *, ROW_NUMBER() OVER(PARTITION BY ID ORDER BY...

    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: Pivot help

    Here's an example.

    The query is modified because I'm not sure that you're using the correct aggregates.

    WITH CTE_Specialty AS(

    SELECT Category ...

    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 (5/24/2016)


    Grumpy DBA (5/24/2016)


    The "Thanks for the script" guy strikes again, necro'ing several old, dead threads.

    And now we shall call him the necroscripter.

    EDIT: I wonder if he's grabbing all...

    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: multiple pivot help

    Gave an answer in this other thread: http://www.sqlservercentral.com/Forums/Topic1789162-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: Pivot help

    ziggy2016 (5/24/2016)


    Hi Guys,

    I hope someone can help me resolve the problem below:

    FYTreatment FunctionAVG_ActivityAPRMayJUNJULAUGSEPTOCTNOVDECJANFEBMARYTD

    2015/16Other150191949494949393929393919192

    2015/16Ophthalmology63994969494959798989797959796

    2015/16Trauma & Orthopaedics100390918989929492919391929191

    2015/16Neurosurgery329295951001009494919596979094

    2015/16Rheumatology11895949798969792919392979895

    Over All Total329386%?86%?86%?86%?86%?86%?86%?86%?86%?86%?86%?86%?86%?

    Basically, all I want is how get the bottom over all avg and percentages...

    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: CONVERT(VARCHAR(10) not working

    Remember that CONVERT won't reformat a string. The column needs to be a date/time data type to allow CONVERT apply the format 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

Viewing 15 posts - 2,806 through 2,820 (of 8,731 total)