Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 How: ? Break out by date and location [B)]

Author  Topic 

pyrrhus_finch
Yak Posting Veteran

51 Posts

Posted - 2004-11-30 : 15:06:08
my data looks like this:

year__month__events_location
2004__Jul_____12____room2
2004__Jul_____2_____room3
2004__Jul_____5_____kitchen
2004__Aug_____18____room 2
2004__Aug_____4_____lounge
2004__Sept____8_____patio
2004__Sept____3_____room2


and i want it to come out looking like this somehow:

______room2_room3_kitchen_lounge_patio
Jul_____12____2______5_______0_____0
Aug_____18____0______0______4______0
Sept____3_____0______0_______0_____8

I'm stumped.
Please help.
Thanks whole bunch.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-12-01 : 08:20:35
You can do this with a cross tab. There is a cross tab query wizard that will get you started. You'll want to put the month on the row, the location on the column, and use FIRST, LAST, MAX, or MIN on the events for the pivoted value. You can modify it from there as needed.
Go to Top of Page

pyrrhus_finch
Yak Posting Veteran

51 Posts

Posted - 2004-12-01 : 18:27:16
Wow. Great. I never knew about the crosstab thing in Access. Saved me a ton of hack work.
Thanks again.
Go to Top of Page
   

- Advertisement -