Forum Replies Created

Viewing 15 posts - 6,646 through 6,660 (of 10,144 total)

  • RE: Alternate rows

    wburnett_1 (9/13/2011)


    Understood, that actually works better for this case, in that it should be more like drawing names from a hat...

    Look up NTILE in BOL, this is what it's...

  • RE: declare table from a string syntax help

    At my last place, the product transaction table was about 70 million rows. A requirement was to extract transactions for a single product - about 30k to 70k rows -...

  • RE: Are the posted questions getting worse?

    Tom.Thomson (9/12/2011)


    ChrisM@Work (9/12/2011)


    WayneS (9/11/2011)


    ALZDBA (9/11/2011)


    :sig:

    The one who's name thow shall not state felt the need to kill a forum newbe with ancient history and lousy advise.

    http://www.sqlservercentral.com/Forums/FindPost1173017.aspx

    The last sentence says it...

  • RE: Are the posted questions getting worse?

    WayneS (9/11/2011)


    ALZDBA (9/11/2011)


    :sig:

    The one who's name thow shall not state felt the need to kill a forum newbe with ancient history and lousy advise.

    http://www.sqlservercentral.com/Forums/FindPost1173017.aspx

    The last sentence says it all about...

  • RE: Will Pivot Table work in this scenario

    You can't put the roof on a house until the walls are up. Start with the foundations - build a query which returns the data you want to process into...

  • RE: Better Query instead of loop

    uciltas-924976 (9/9/2011)


    Hi Chris,

    I just realized a minor problem on the code you sent.

    To handle [AVG-DAYS] we said to use when it is current month data CTR_UPDATED will be getdate()

    So...

  • RE: Mathematical Theory (controversy!)

    GSquared (9/9/2011)


    ChrisM@Work (9/9/2011)


    GSquared (9/8/2011)


    ...breeding dogs for 10,000 years has yet to produce a T-Rex...

    Isn't it fortunate for us that this wasn't the intention from the outset?

    I don't know.

    I think scritching...

  • RE: Multiple select/table join query

    in_beta (9/9/2011)


    Hi Chris,

    Ok, I'll try attempt a rough table output, I'll omit DocDate unless you specify otherwise.

    ...

    You're new here - this is better:

    USE tempdb

    GO

    SET DATEFORMAT MDY

    CREATE Table OCRD (CardCode VARCHAR(20),...

  • RE: Multiple select/table join query

    Let's assume for a moment that the results aren't quite what you're expecting because of dupes in the output. Now, if you were to set up sample data scripts with...

  • RE: Multiple select/table join query

    Something like this?

    SELECT

    ocrd.CardCode,

    ocrd.CardName,

    ocrd.CntctPrsn,

    ocrd.Phone1,

    ocrd.Cellular,

    YearTotal = (ISNULL(oinv.debit,0)-ISNULL(orin.credit,0))/1.1,

    Jan2010Total = (ISNULL(moinv.dMTD,0)-ISNULL(morin.cMTD,0))/1.1

    FROM OCRD ocrd

    LEFT JOIN (

    SELECT cardcode, debit = SUM(DocTotal)

    FROM oinv

    WHERE DocDate BETWEEN '2010-01-01 00:00:00.000' AND '2010-12-31...

  • RE: 2nd highest value in dataset

    ;WITH OrderedData AS (

    SELECT

    patient_id,

    attendance_date,

    rn = ROW_NUMBER() OVER (PARTITION BY patient_id ORDER BY attendance_date)

    FROM PS_TestForOnline

    )

    SELECT *

    FROM OrderedData v1 -- first visit

    LEFT JOIN OrderedData v2...

  • RE: Time data type and negative TimeSpan values?

    The difference between two times isn't a time, it's a quantity. You could use an integer datatype to store the number of minutes difference between the two times - easily...

  • RE: Mathematical Theory (controversy!)

    GSquared (9/8/2011)


    ...breeding dogs for 10,000 years has yet to produce a T-Rex...

    Isn't it fortunate for us that this wasn't the intention from the outset?

  • RE: Mathematical Theory (controversy!)

    Naked Ape (9/8/2011)


    ...about 1% of lizards are capable of parthenogenesis...

    Including, surprisingly, the biggest. One convenient theory for Komodo parthenogenesis is their habitat - there's a higher probability of an island-dwelling...

  • RE: declare table from a string syntax help

    The Dixie Flatline (9/8/2011)


    I have to ask: If all of the tables have similar data, why aren't you simply using one big table?

    The...

Viewing 15 posts - 6,646 through 6,660 (of 10,144 total)