PDA

View Full Version : SubQuery Amnesia???



stanl
11-19-2012, 01:12 PM
I cannot come up with a query (in Access) for this:

I have 2 tables: Agents with AgentID

and calls With Date, AgentID, Category, Cnt [Count]

So on any given day an agent can have calls to any number of categories, but 1 category is contained in every day [call it D]

So Select Count(cnt) [create inner join the ID's] order by date, category can give me the counts for all categories or the total count per agent per day.

and using WHERE category="D" can give me the count for my main category.

I want to perform a subquery to get either (1) the total count for all categories and the count for D or (2) the percentage of D for the total count - by agent by date,

every subquery (and I am embarresed to post them) I have tried has failed.:banghead:

mohanvijay
11-20-2012, 07:24 AM
can you post sample data and your desired output?

stanl
11-20-2012, 12:45 PM
Figured it out.