Cross-tab query?

  • I have 2 tables, one called 'Names' (ID int, Name varchar), and another called 'Schedule' (ID int, nameID int, startTime datetime, endTime datetime). The schedule table is related to the names one via the nameID field. Basically they are tables of peoples names and times that they are scheduled to work. What I would like to do is have someone select a date range and create a report for all people of the times they work for that period. I would like to have the dates selected be column headers, the name of the person be the row header, and the time they work for that specific date as the data. Is this a cross-tab query? If not, does anyone know a way to do this, my SQL skills are lacking here?

    Thank you in advance for any help offered

  • This was removed by the editor as SPAM

  • Here's a crosstab query I created:

    http://qa.sqlservercentral.com/scripts/contributions/936.asp

    Hope this helps somewhat.

  • Thanks, I appreciate the info. However, I actually found a different way to get around the problem in my program. Sorry, I should have posted that on the topic once I figured it out. I will take a look at that cross-tab query though, as I think I'm going to need to know how to do these in the future.

Viewing 4 posts - 1 through 3 (of 3 total)

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