Connecting Tech Pros Worldwide Help | Site Map

sub-queries using the IN Clause

Paul Wagstaff
Guest
 
Posts: n/a
#1: Aug 24 '07

Hi all

For many years I've had a need to produce many views using (at least) these
fields:

Field: ID
Field: User
Field: DateCleared

In this example, imagine the user's are reviewing a customer case, which is
considered 'live' until the user enters a clearance date

I want to count the total mumber of reviews per user and the total they've
cleared between various dates and show this data in a single view:

Group By: User Count: Total Workload Count: Total Cleared

I've always written two queries and then joined them togethor with a left
join on the Users field. I'd prefer to handle this with one query, but am
having trouble adapting what I've found to my problem.

thanks
paul


bobh
Guest
 
Posts: n/a
#2: Aug 24 '07

re: sub-queries using the IN Clause


Hi,
off the top of my head............
Make a query and add ID, User, DateCleared twice
Change the query to a 'totals' query
on the totals line group ID, group User, group first DateCleared,
count second Datecleared

this should get you started.........
bobh.

On Aug 24, 11:31 am, "Paul Wagstaff" <paulwagst...@blueyonder.co.uk>
wrote:
Quote:
Hi all
>
For many years I've had a need to produce many views using (at least) these
fields:
>
Field: ID
Field: User
Field: DateCleared
>
In this example, imagine the user's are reviewing a customer case, which is
considered 'live' until the user enters a clearance date
>
I want to count the total mumber of reviews per user and the total they've
cleared between various dates and show this data in a single view:
>
Group By: User Count: Total Workload Count: Total Cleared
>
I've always written two queries and then joined them togethor with a left
join on the Users field. I'd prefer to handle this with one query, but am
having trouble adapting what I've found to my problem.
>
thanks
paul

Closed Thread