Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)

  • RE: "Duplicate" records - How to coalesce?

    TheSQLGuru (5/25/2016)


    Come now - I know you could have figured this one out by extending what I had!! 😛

    You scared the crap out of me with that second post w/DENSE_RANK,...

  • RE: "Duplicate" records - How to coalesce?

    TheSQLGuru (5/25/2016)


    I need all expected outputs for your sample data.

    NEWIDFROMIDTOIDFROMRELATIONTORELATIONNOTESSTATUS

    1CMTNAA0015DQCMTNAA0012QTMother-in-LawSon-in-LawIn, LawActive

    2AMTNAA000QGCAMTNAA000K3SClientVendorSunglassesActive

  • RE: "Duplicate" records - How to coalesce?

    TheSQLGuru (5/25/2016)You are very welcome. When you have 45000 hours working with SQL Server your brain will probably think like mine too. 😎

    I've been off in force.com land and haven't...

  • RE: "Duplicate" records - How to coalesce?

    drew.allen (5/25/2016)


    Here is another approach. This has the advantage that it accounts for orphaned records.

    Drew

    Thanks Drew! In this case we don't want the orphans; I know, not ideal but...

  • RE: "Duplicate" records - How to coalesce?

    TheSQLGuru (5/25/2016)

    You see how I set up the sample data? You do the work to set up the next set of sample data and what your expected output is. Be...

  • RE: "Duplicate" records - How to coalesce?

    Wow Kevin, that's like light years beyond my sql skills, thanks a ton!

    So I have 4 other fields in mix that I need to bring along and your solution is...

  • RE: "Duplicate" records - How to coalesce?

    Kevin,

    It doesn't matter which one of the ENTITYID's is the To or From. Maybe just use the 1st row as From if that works?

  • RE: "Duplicate" records - How to coalesce?

    When I join the table to itself, I end up with two rows since each row has it's sibling as the BACKAFFILID.

    AFFILIATION INNER JOIN AFFILIATION AS AFFILIATION_1 ON AFFILIATION.BACKAFFILID =...

  • RE: Dates between tables

    Thanks for everyone's input... I got it:

    Service INNER JOIN Fiscal ON SDATE BETWEEN DATEADD(d, -6, WEEKEND) AND WEEKEND

  • RE: Dates between tables

    sunitabeck (4/2/2011)


    Are the data types datetime or smalldatetime? If not - for example if the columns are varchar, this can happen. If so, cast the column to datetime or smalldatetime...

  • RE: Dates between tables

    parthi-1705 (4/5/2011)


    Sturev (4/2/2011)


    I have a need to pull a date column from one table based on the date in another.

    How you are doing for November month?

    i.e say service date...

  • RE: Dates between tables

    homebrew01 (4/2/2011)


    Sturev (4/2/2011)


    I have a need to pull a date column from one table based on the date in another.

    1/2/2010 is greater than 12/30/2009, so why doesn't > work ?

    There...

Viewing 12 posts - 1 through 12 (of 12 total)