Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2010

    Post Unanswered: CrossTab Query In SQL 2008

    Hi Experts,
    I have a calling details table which contains AgentId, CallDate, RespType etc.
    Now I want a crosstab query to get AgentId as row and CallDate as column header. want to show total number of calls each day for last 7 days.

    Let me clear further: lets say if i select CallDate=07-Nov-2010, then result should look like this:

    AgentId 07-Nov 06-Nov 05-Nov 04-Nov 03-Nov 02-Nov 01-Nov
    1111 24 10 32 15 16 52 65
    2222 20 25 50 57 61 25 51

    Can any body help me with a sql query for the same.

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    A Pivot or CrossTab needs to be built at the client, not at the database server. Your choice of client tools ought to produce the query for you "under the covers" as part of the component that builds the Pivot GUI.

    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts