Forum Replies Created

Viewing 15 posts - 3,886 through 3,900 (of 5,504 total)

  • RE: Cross tab and Moving running totals

    I would do it in three steps:

    step 1: build an intermediate table with preaggregated values

    step 2: do the quirky update

    step 3: display the pivoted data using crossTab

    Something like this (side...

  • RE: Pivot Question

    Based on your description and ready to use sample data it was really easy to work on and to match your desired result.

    This is one of the very best formats...

  • RE: Pivot Question

    Something like this? (The trick is to assign a number to each row per Region and use this new column to group the data, thus eliminating the null values).

    SELECT

    MAX(ISNULL(pvt.[Region...

  • RE: Extract Monthly report but Different DATE Format data into SQL server 2005 Database

    poratips (3/30/2010)


    Hi Lutz,

    Thanks so much for your help!

    When i alter to add columns as datatime datatype and update my both the columns, can you show me how to make date...

  • RE: Need help in XML insert -identity values

    Hi Chandru,

    select @l_identity=@@identity

    will only return the last row and not all rows. You'd need to use the OUTPUT clause together with an intermediate table. See the code snippet below.

    Please note...

  • RE: crosstab SQL Server 2000

    The Dixie Flatline (3/29/2010)


    It's not so bad, Lutz.

    ROW_NUMBER() + Tally table + CASE expression = powerful dynamic SQL. 😀

    ...

    I'd love to agree but, unfortunately, the...

  • RE: Are the posted questions getting worse?

    Right now we're just guessing regarding her(his?) identity.

    As long as there is no proof that we're talking about the same person I'm not going to make such an assumption.

    It might...

  • RE: Are the posted questions getting worse?

    Just being curious: How close is that particular behavior of that specific person to be qualified as being a Troll? (disclaimer: limited to that particular thread due to the lack...

  • RE: Delete duplicate rows in a Table?

    Did you try to search for "delete duplicate rows" on this site (using the search box on the upper right corner of this site).

    You probably will find this link as...

  • RE: Importing a file getting Error: The column delimiter for column "MyColumn" was not found.

    Without seeing two rows (one that passed and one that failed) it's almost impossible to say what's causing the error...

  • RE: crosstab SQL Server 2000

    Ughh!

    That's going to be quite a bit of work...

    Do you have any chance to either use SS2K5 or above or at least get the Date values numbered for each...

  • RE: crosstab SQL Server 2000

    orca (3/26/2010)


    Sorry, my workstation I has SQL 2008 express installed, but the server is SQL 2000 (I'm not testing against real data).

    So, on what version do you want to use...

  • RE: crosstab SQL Server 2000

    orca (3/26/2010)


    Thank you. I don't fully understand what's happening, but when I run the query it creates one column for all followups, and I need one column for each followup...

    That's...

  • RE: Extract Monthly report but Different DATE Format data into SQL server 2005 Database

    ALTER TABLE [dbo].[SSTrackTime] ADD Start_datetime DATETIME

    ALTER TABLE [dbo].[SSTrackTime] ADD Stop_datetime DATETIME

    GO

    UPDATE [dbo].[SSTrackTime]

    SET

    start_datetime = CASE WHEN ISDATE(START)=1 THEN START ELSE CAST(START AS XML).value('xs:dateTime(.[1])', 'datetime') END,

    stop_datetime =...

  • RE: Need help with conditional column

    instead of

    CASE WHEN client_ind = 'Y'

    THEN picklist1ms AS CaseType

    ELSE '' AS CaseType

    END

    it needs to be

    CASE WHEN client_ind = 'Y'

    THEN picklist1ms

    ELSE ''

    END AS CaseType

    Edit: ... just like...

Viewing 15 posts - 3,886 through 3,900 (of 5,504 total)