Counting Records that meet conditions

matt330

Registered User.
Local time
Yesterday, 20:09
Joined
Jul 20, 2004
Messages
31
I'm having difficulty with couting records that meet a condition. Hopefully this will make sense.

On my report I have visit dates (1,2,3,4 & 5) that are populated from a table. Each visit date has a window it should fall in, so on the report I have both an early window and a late window. I've put conditional formatting on the "Actual Visit Date" so that if it is less than "earlywindow" it is highlight green, if it is greater than "latewindow" it is highlighted red. So there are two conditions on each "actualvisitdate"

To keep it simple right now I'm only working with "Visit 1". Is there a way to count the number of records that meet the criteria for the early window (conversely the late window as well)?

In other words I need I need a control that displays the number of records that are highlighted green, and the number of records that are highlighted red.

Thanks for any assistance.

Matt
 
Table1
Code , amount
a 10
b 5
c 2
b 10
a 20
c 10


SELECT table1.code, Sum(table1.amount) AS SumOfamount
FROM table1
GROUP BY table1.code;

Result
Code , amount

a 30
b 15
c 12
 

Users who are viewing this thread

Back
Top Bottom