A
Adam Pedder
I've got a problem with a query that I'm sure should be quite simple.
Basically I have a table that looks like this:
Date | Agent
01/01/2001 | 12345
01/02/2001 | 12345
01/01/2001 | 12346
An I want to return this:
Count 1 | Agent | Count 2
1 | 12345 | 2
1 | 12346 | 1
Where Count 1 is the number of claims since 01/02/2001 and Count 2 is the
number of claims since 01/01/2001.
Count 1 is easy with Select Count(*), agent from Claims where date >
'01/02/2001' group by agent.but I cannot get Count 2 in there.
I'm at the point of using a temporary table to store the results, but there
must be a simple way of Joining two select statements on the same table.
Can anyone help?
Adam
Basically I have a table that looks like this:
Date | Agent
01/01/2001 | 12345
01/02/2001 | 12345
01/01/2001 | 12346
An I want to return this:
Count 1 | Agent | Count 2
1 | 12345 | 2
1 | 12346 | 1
Where Count 1 is the number of claims since 01/02/2001 and Count 2 is the
number of claims since 01/01/2001.
Count 1 is easy with Select Count(*), agent from Claims where date >
'01/02/2001' group by agent.but I cannot get Count 2 in there.
I'm at the point of using a temporary table to store the results, but there
must be a simple way of Joining two select statements on the same table.
Can anyone help?
Adam