Forum Replies Created

Viewing 15 posts - 26,296 through 26,310 (of 26,484 total)

  • RE: SQL syntax

    Unfortunately, that is DB2 syntax.  You have to use T-SQL syntax with MS SQL Server.  Even in your own code you used T-SQL.

    Original post:

    The DB2 equivalent would be:

    select * from...

  • RE: Warehouse... need min and max for each data field per table...

    Since you are using a temp (#) table, change them from a local temp table (#) to a global temp table (##).

    hth

    Lynn

  • RE: SQL syntax

    An update:

    1st, Edwin's query was this:

    Select * From Table

    Where Date(timestamp_column) >= DateAdd(Day, 1, DateAdd(Month, -1, Convert(Char(10), GetDate(), 120)))

    I don't see where you included this query into your test.

    You remind me...

  • RE: SQL syntax

    Using your own terms:

    Challenge met!

    Oh, I get it, if the results don't match what is expected, change the requirements of the challenge!

    I met the requirements, 100000 records in the table.  Pulled...

  • RE: SQL syntax

    Sergiy,

    I took your challenge and created a table (actually 2) with 100000 rows.  I then used 2 queries one using Edwin's method of determining the starting date and one with...

  • RE: SQL syntax

    Sergiy,

    Tactfully pointing out a better way of doing things is one thing.  The way you approached this particular situation was anything but tactful.  Using words like "stupid", '"liar", etc. is not...

  • RE: SQL syntax

    Edwin,

    Personally, I'd rather get it right first then work on enhancing performance.  If doing a date conversion in a query makes it clearer what you are trying to do, then...

  • RE: SSIS Derived column question

    Looking at BOL, you need to but the dd in double quotes: "dd"

  • RE: Changing 2 fields - will I loose data?

    There are several ways to change fields.  In place as was originally provided; using a temporary table; and a third is to add two new columns, copy the data from...

  • RE: Changing 2 fields - will I loose data?

    Just an alternative, and it ensures you don't lose data if that is a concern.

     

  • RE: Changing 2 fields - will I loose data?

    Another alternative to try in development first is this:

    1. Create a new table called tmp_tablename that is identical to your existing table, but with the columns your are changing defined...

  • RE: Left Outer Join while eliminating Duplicates

    Not sure if this will work as advertised, but it is worth a try:

    select

        a.*,

        b.pob_system_date,

        b.pob_company,

        b.pob_site,

        b.pob_po_nbr,

        b.pob_line_nbr

    from

        dbo.SALES a

        left join dbo.PO b

            on (a.company = b.pob_so_company...

  • RE: Get Date & DateName Help - newbie questions.

    The answer was wrong, yes, but the principle behind it was correct.  The rest is up to the user.

  • RE: Get Date & DateName Help - newbie questions.

    Good teachers make themselves unnecessary by helping the student to learn without having to hold thier hand all the time.  I would prefer to have someone show me the way,...

  • RE: Get Date & DateName Help - newbie questions.

    No, he didn't.  But I think he noticed, as his experimenting used 14 instead of 21.  And he did indicate that my solution was slick, and simplier than what he...

Viewing 15 posts - 26,296 through 26,310 (of 26,484 total)