July 2, 2008 at 5:35 pm
I am writing a report where I need to return a list of all cases an 'agent' was involved in, for each agent in the dept, as well as some summary statistics.
Each row in my datasource represents a 'case'. Up to two agents can be involved in a case, so there is a column 'agent1' and a column for 'agent2' in each row.
Since I cannot group on agent, I am wondering what is the best way to accomplish this?
Should I write a report where the agent ID is a parameter and then just run/write a script to run the report for every agent ID?
Or is there a better way to do this?
July 3, 2008 at 7:09 am
Or is there a better way to do this?
2 agents in one row is not normalized data. Split the agents out into a separate table, and you'll find that your query now just auto-magically flows together nicely.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply