Forum Replies Created

Viewing 15 posts - 31 through 45 (of 117 total)

  • RE: How to convert this XML into columns

    Sean Lange (4/9/2012)


    I have to agree with Lynn. How about we take this approach, you go dig through the 100+ posts of mostly nonsense and find the ddl and sample...

  • RE: How to convert this XML into columns

    All I need is one column value and that the FROM_PAY_RATE column. IN my DDL post, everything works, but not the FROM_PAY_RATE. It needs to correspond with the final row...

  • RE: How to convert this XML into columns

    I apologize and I am a bit surprised this topic went this long. I blame myself, but I am trying new things and I am being an A-Hole doing it....

  • RE: How to convert this XML into columns

    njdevils39 (4/6/2012)


    LutzM (4/6/2012)


    njdevils39 (4/6/2012)


    ...

    Where should I put this query in my original SQL CODE? Note: Include EMP_NAME, EMP_ORGANIZATION, EMP_DEPARTMENT and EMP_DT_TERMINATION.

    I have no idea.

    It would make sense to place it...

  • RE: How to convert this XML into columns

    LutzM (4/6/2012)


    njdevils39 (4/6/2012)


    ...

    Where should I put this query in my original SQL CODE? Note: Include EMP_NAME, EMP_ORGANIZATION, EMP_DEPARTMENT and EMP_DT_TERMINATION.

    I have no idea.

    It would make sense to place it somewhere...

  • RE: How to convert this XML into columns

    LutzM (4/6/2012)


    Are you looking for something like this?

    WITH cteRates AS

    (

    SELECT

    o.EMP_ID,

    (ROW_NUMBER() over(partition by o.EMP_ID order by x.r.value('@date_changed','DATETIME') desc)) as RowNum,

    convert(VARCHAR(10), x.r.value('@date_changed','DATETIME'), 101) AS DATE_CHANGED,

    ...

  • RE: How to convert this XML into columns

    Sean Lange (4/6/2012)


    That won't run. There is a where clause stuck in there that I can't figure out what you are trying to with.

    Some XML Files have only one row...

  • RE: How to convert this XML into columns

    Sean Lange (3/30/2012)


    I suggested a couple of options in my previous post. What happened when you tried either of those ideas?

    Here is my latest code, but still not the result...

  • RE: How to convert this XML into columns

    I am only trying to figure out how to get the FROM_PAY_RATE column. Like the RowNUm has to be 1 and the From_Pay_RATE has to match the Final RowNum.

    So min(convert(VARCHAR(10),...

  • RE: How to convert this XML into columns

    This is what I have so far:

    -- SELECT * FROM EMPLOYEE WHERE EMP_NAME IN ('Whitehead, Molly','Gentry, Clinton A ','Crosby, Sherman','Riddle, Nichole')

    CREATE TABLE #EMPLOYEE2

    (

    EMP_ID INT,

    EMP_NAME VARCHAR(MAX),

    EMP_ORGANIZATION VARCHAR(MAX),

    EMP_DEPARTMENT VARCHAR(MAX),

    EMP_DT_TERMINATION DATETIME

    )

    CREATE TABLE...

  • RE: How to convert this XML into columns

    Sean Lange (3/30/2012)


    njdevils39 (3/30/2012)


    Sean Lange (3/30/2012)


    The query I provided should be a good starting point. Show me what you have tried.

    One problem with your query is that its giving me:

    Msg...

  • RE: How to convert this XML into columns

    Sean Lange (3/30/2012)


    The query I provided should be a good starting point. Show me what you have tried.

    One problem with your query is that its giving me:

    Msg 208, Level 16,...

  • RE: How to convert this XML into columns

    Sean Lange (3/30/2012)


    What do you have so far?

    Every Value is correct except for the last 3 columns;

    In DATE_CHANGED its giving me '2008-12-28 00:00:00.000'

    In FROM_PAY_RATE its giving me 0

    IN TO_PAY_RATE its...

  • RE: How to convert this XML into columns

    The problem I've been getting is trying to get the correct date, and getting the value from the rate column in the XML table.

  • RE: How to convert this XML into columns

    Sean Lange (3/30/2012)


    This will give me a result which looks like this, but the data in the last 3 columns is wrong:

    What does that mean? How about if you post...

Viewing 15 posts - 31 through 45 (of 117 total)