Question : How to sum (distinct values) in Access Report

Hi,
  I have a column say, Task estimation in my Access report in the detail part.
I need to take sum of distinct estimated value

Eg.,
Report1 - grouped on Activity

Activity Tasks   Estimation
A1        T1         200
A1        T1         200
A1        T2          50
A1        T2          50
A1        T3          500

I need to display (T1 - 200) + (T2 - 50) + (T3 - 500) as sum of Activity A1 (750).

How to consider distinct estimation values to take a sum in Access report?

Answer : How to sum (distinct values) in Access Report

You are going to need a separate query to get the total.

select Activity, sum(estimation) as TotEstimate from
(Select distinct activity, tasks, estimation from table) as q1
Group by activity

Ssve as qryTotest

You then have a choice of how to get the value..recordset, subfor, dlookup

simplest is a dlookup.

textbox with a controlsource of..
=Dlookup("totestimate", "qrytotest","activity='" & me.activity)
Random Solutions  
 
programming4us programming4us