Forum Replies Created

Viewing 15 posts - 46 through 60 (of 256 total)

  • RE: Multiple pivot columns

    I replied too soon. I need the result in one record and that solution gives the result in multiple records. Any other solution?

  • RE: Multiple pivot columns

    Hi all,

    I found the solution and it is as simple as(without any commas between pivots and the field names has to be unique):

    Select * from (select * from tbl) p

    PIVOT(MAX(col1)...

  • RE: Format decimal to have zero in front

    I could not convert it to string because some of the data is not in decimal format. So my issue is now resolved.

    Thanks for your help.

  • RE: Format decimal to have zero in front

    Sartori,

    I liked your alternate solution better. It converts to string, but how do I convert the result back to decimal?

    Thanks.

  • RE: Format decimal to have zero in front

    I should have searched on this site before posting, I apologize. I found the solution on this site as:

    REPLICATE('0',(3-len(floor(Entry))))+ cast(Entry as nchar(20))

    Thanks to whoever contributed the solution.

  • RE: Help with query

    DISTINCT cannot work in this case but wrapping the query in select clause does work. Thanks to Sean and David.

    Thanks again.

  • RE: Help with query

    Any help will be appreciated.

    Thanks.

  • RE: Agregate join

    Thanks JonFox, that is what I was looking for. Thanks again.

  • RE: Division problem

    Thanks.

  • RE: Dynamic query problem

    I found an example on BOL as Lynn stated and is working now. The first parameter to sp_executesql has to be Nvarchar and not varchar.

    Thanks.

  • RE: Challenging table join problem

    Painfully, I got it working. The query is much more complex than the columns are gave you. What I end up doing is, I created another query that would give...

  • RE: Challenging table join problem

    What I need is another column showing percentage of each of record by

    like

    Convert(float,AVG(MyScale)) * 100 / SUM(AVG(MyScale))

    but since I am using AVG, I cannot use SUM at the same...

  • RE: Challenging table join problem

    I enterd the data but it got rid of the space. the Id is just an int column, myScales is a float, scale is a 1 digit column and rest...

  • RE: Challenging table join problem

    I got working with the first solution from GSquared. Thanks.

    Now i have a result as follows:

    ID myScales Scale ...

  • RE: Challenging table join problem

    Hi GSquared,

    That worked perfectly! Thank you for your time.

Viewing 15 posts - 46 through 60 (of 256 total)