Forum Replies Created

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

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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 =...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Need help with query to strip out certain accounts

    Something like this?

    ;WITH cte AS

    (

    SELECT 50420 AS val UNION ALL

    SELECT 50421 UNION ALL

    SELECT 50422 UNION ALL

    SELECT 50423 UNION ALL

    SELECT 55030 UNION ALL

    SELECT 56640 UNION ALL

    SELECT 51010 UNION ALL

    SELECT 53010 UNION...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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

    You have an answer on how to convert your character values into datetime format.

    I also answered your question on how to get your input values transformed into datetime values (using...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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