Forum Replies Created

Viewing 15 posts - 6,241 through 6,255 (of 10,144 total)

  • RE: Case With Group by Row Values into Column

    Here's a start. Test and comment.

    Declare @portfolioId Varchar(8000),

    @ParentWorkids Varchar(50)

    Set @portfolioId = '1800m380000iot22g3t0000000_1800m380000io7c5nr50000000' -- this looks like TWO concatenated portfolioIds

    set @ParentWorkids = '1801a2g0000ih0vl2abg000000'

    ---------------------------------------------------------------------------

    SELECT child_work_id = [object_id],

    PrimaryBBPProcess = MAX(CASE WHEN...

  • RE: Case With Group by Row Values into Column

    Sean Lange (6/15/2012)


    farooq.hbs (6/15/2012)


    Yup results are Correct

    but Honestly not hapy with my queryy

    Plz do let me know if there is any other option so tht query runs fast

    The answer starts...

  • RE: Case With Group by Row Values into Column

    SELECT from the whole query as a derived table. Create the totals as new columns in the output list.

    Are you happy with your query?

    How does it perform?

    Are the...

  • RE: Case With Group by Row Values into Column

    farooq.hbs (6/15/2012)


    Hey Guys

    If I want to make Sum Of this HardSAvingFY11 And HardSavingFY12 in the Query ?? Is there any option for this?

    -- Enhanced Query For Your Requirement

    SELECT

    HardSavingFY10,

    HardSavingFY11,

    HardSavingTotal...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (6/15/2012)


    ChrisM@Work (6/15/2012)


    Brandie Tarvin (6/15/2012)


    You know, it's a really sad state of affairs when the actions of a few bad posters start giving us enough of a reputation that...

  • RE: Are the posted questions getting worse?

    Brandie Tarvin (6/15/2012)


    You know, it's a really sad state of affairs when the actions of a few bad posters start giving us enough of a reputation that someone has to...

  • RE: How to query results in debit and credit column

    yingchai (6/15/2012)


    Thanks to all the feedback. It is actually a work problem, not a homework problem 🙂

    It has few of the characteristics of a homework problem. Folks who are too...

  • RE: Nested CASE statement with in operator

    What version of SQL Server are you using?

  • RE: Unpivoting Data

    vinu512 (6/15/2012)


    ChrisM@Work (6/15/2012)


    anthony.green (6/15/2012)


    Thanks guys, much appreciated. Was racking the brain yesterday on that and for the life of me couldnt get unpivot working.

    I like the idea of the...

  • RE: Unpivoting Data

    anthony.green (6/15/2012)


    Thanks guys, much appreciated. Was racking the brain yesterday on that and for the life of me couldnt get unpivot working.

    I like the idea of the values list,...

  • RE: Unpivoting Data

    dwain.c (6/14/2012)


    ChrisM@home (6/14/2012)


    Have you tried a VALUES list? With CROSS APPLY?

    Gosh Chris! Did you mean like this?

    SELECT APUserID, TypeID, Something

    FROM @SampleData

    CROSS APPLY (

    VALUES ('FirstName', FirstName)

    ...

  • RE: Eliminating Duplicate Rows

    prakashp 84206 (6/15/2012)


    Thanks ChrisM, for your efforts for me.

    But it gives me error "Out of Memory" and not able to execute. What to do?

    Fix it - something we are...

  • RE: How can I return value from function that comes from dynamic sql

    iTVF equivalent:

    CREATE FUNCTION GetExchangeRate

    (@extype nvarchar(10), @dt nvarchar(50))

    RETURNS TABLE

    AS

    RETURN

    (

    SELECT TOP 1 -- ratedate, x.Currency, -- testing only

    exrt = x.Rate

    FROM ExRates

    CROSS APPLY(VALUES ('USD',USD), ('EURO',EURO)) x (Currency, Rate)

    WHERE x.Currency...

  • RE: How can I return value from function that comes from dynamic sql

    aykut canturk (6/14/2012)


    <<snip>>How can I get exchange rate for specific date ?

    any suggestions please ?

    Is USD an exchange type or a currency?

    Does "Exchange Type" really mean "Currency"?

    What do you have...

  • RE: Finding the right JOIN type

    Sean Lange (6/14/2012)


    At this point it seems the two of you are putting in far more effort on this than the OP. 😉

    I'm outta here mate 🙂 job done.

Viewing 15 posts - 6,241 through 6,255 (of 10,144 total)