Pivot issues

  • Happy holidays!

    I am having issues using PIVOT. I have never seemed to truly understand the syntax behind it and I know this is a simple question....

    I have a simple table that has 3 columns: DayofWeek (Mon - Fri), Time(8:00AM - 5:00PM for each day), and CallsOffered (This is the aggregate). I just need to pivot on the DayofWeek, so I can have Mon - Friday as column names and I cannot seem to do it correctly.

    Any help would be greatly appreciated!

    Dave

  • You could read this article to find out how to work with CROSS TABS.

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    For a coded answer, please read the article linked in my signature to now what we need to help you.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Dude, I am asking for a simple PIVOT example. I am not sure why this is an issue? Please do not clog up my post with links. I am on a strict deadline.

  • I'm helping here for free.

    If you want simple examples, you can press F1 and find examples on PIVOT. Or you can click on the "useless" link I provided to have different examples.

    If you want examples based on your tables and information, you should give us something to work with as you're not the only one with deadlines.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Can someone help me please?????

  • I am not sure if I can create a simpler example than this...

    Happy holidays!

    I am having issues using PIVOT. I have never seemed to truly understand the syntax behind it and I know this is a simple question....

    I have a simple table that has 3 columns: DayofWeek (Mon - Fri), Time(8:00AM - 5:00PM for each day), and CallsOffered (This is the aggregate). I just need to pivot on the DayofWeek, so I can have Mon - Friday as column names and I cannot seem to do it correctly.

    Any help would be greatly appreciated!

  • DaveDB (12/27/2013)


    Dude, I am asking for a simple PIVOT example. I am not sure why this is an issue? Please do not clog up my post with links. I am on a strict deadline.

    You should post sample data, DDL and desired results if you want a working solution.

    If you just want examples, there are thousands out there.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 7 posts - 1 through 6 (of 6 total)

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