PIVOT Table

  • Hi all,

    could someone please help me with the query below. It is about changing a query which has a PIVOT statement from microsoft access into SQL Server SP.

    i did google for solutions and found some basic ones, but they did not help me, the query i am dealing with is way complected for me as a new SQL Server user. i have been trying to solve this problem all day and got nothing, so please HELP me !!

    this is the SQL view from access:

    TRANSFORMCount(tblA.A) AS Something

    SELECTtblB.C

    FROMtblC

    INNER JOIN (tblA

    INNER JOIN tblB ON tblA.B = tblB.B) ON tblC.A = tblA.A

    WHERE tblC.Date Between @StartDate And @EndDate

    GROUP BY tblB.C

    PIVOT tblA.D In ("1","2","3","4");

    result for running this query from access:

    C,,,,,,,,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,2,,,,,,,,,,3,,,,,,,,,,,4

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

    Something 1,,,,,,,,,,,,,,,,,,,,,,,1

    Something 2,,,,,,,1

    Something 3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2

    ", = space"

    Thanks, and looking forward to hearing from you

  • post sample data with table definiton . see the link in my signature

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply