Forum Replies Created

Viewing 15 posts - 406 through 420 (of 844 total)

  • RE: The SQL Joke Thread

    A DBA walks into a restaurant, then runs screaming from the building.  Why?  All of the tables were empty.

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: The SQL Joke Thread

    What do you get when you cross a shark with a porcupine?  A SQL(sea quill).  Or SQL BITeS

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: I need to "group" two rows of data, but cannot seem to figure it out

    randyetheridge - Thursday, April 19, 2018 2:02 PM

    ok yes, the expected output does not have the local  currency identified.  the reason for this...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: I need to "group" two rows of data, but cannot seem to figure it out

    John Mitchell-245523 - Tuesday, April 17, 2018 12:16 PM

    This has got to be close.  It looks right, although my result set has...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: I need to "group" two rows of data, but cannot seem to figure it out

    Try this:
    SELECT L.Entity, L.Account,
      COALESCE(R.Local_Currency_ID, L.Report_Currency_ID) AS Local_Currency_ID,
      L.Report_Currency_ID,
      L.Amt AS USAmt,
      COALESCE(R.Amt, L.Amt) AS Amt
    FROM (SELECT U.Entity, U.Account, U.Currency AS Report_Currency_ID,...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: I need to "group" two rows of data, but cannot seem to figure it out

    CREATE TABLE #CIM_FACT
    (
        YearYYYY    nvarchar (4) not null ,
        Period        nvarchar (10) not null,
        Entity        nvarchar (10) not null,
        Account        nvarchar (10) not null,
        currency    nvarchar (10) not null,
        Amt            Decimal (18, 2) not null

    );

    Insert INTO #cim_Fact
    VALUES ('2018','January','ENT_1000','1588','USD Total',-888823191.97),
        ('2018','January','ENT_1000','1591','USD...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: How to replace certain part of a string ?

    You don't need the loop if you combine Sean's code with the answer you got from your other post.
    https://www.sqlservercentral.com/Forums/1932209/How-do-I-count-the-number-of-occurrences-the-character-P-in-the-string

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: Are the posted questions getting worse?

    Sean Lange - Wednesday, April 11, 2018 10:27 AM

    WOW. The company who built our ERP apparently also created some ETL jobs for...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: I need to "group" two rows of data, but cannot seem to figure it out

    Not sure, but give this a try:
    SELECT L.Entity, L.Account,
        R.Local_Currency_ID,
        L.Report_Currency_ID,
        L.Amt,
        R.Amt
    FROM (SELECT U.Entity, U.Account, U.Currency_ID AS Report_Currency_ID, R.Amt
            FROM Your_Table AS U
            WHERE Currency_ID...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: Subtract Year from Year and Month

    There may be a better way, but here you go:
    DECLARE @yearMonth CHAR(7);
    DECLARE @prioryearMonth CHAR(7);

    SET @yearMonth = '2017-06';

    SET @prioryearMonth = CONCAT(CAST(LEFT(@yearMonth, 4) AS...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: The SQL Joke Thread

    Jeff Moden - Friday, April 6, 2018 1:54 PM

    below86 - Friday, April 6, 2018 9:43 AM

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: The SQL Joke Thread

    Do you know why Jeff had to get out of the construction business?
    He refused to use RBAR!

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: Need simpler way to see a list of my posts and possible replies to them

    Luis Cazares - Tuesday, April 3, 2018 11:52 AM

    below86 - Tuesday, April 3, 2018 10:44 AM

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: Need simpler way to see a list of my posts and possible replies to them

    Click on your profile name, up in the right corner.  In your Profile look under 'Topics' for posts you've started.  Click on 'Replies' for those that you've replied to.

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • RE: ETL or ELT

    ELTL, Is the way I would describe how I prefer to handle this data.  Trying to figure out what record in a delimited file has the bad value(using ETL) when...

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

Viewing 15 posts - 406 through 420 (of 844 total)