result in each line in one query?

G

Guest

Hello!

I have customers in one column and days overdue in another.

customer overdue
180912 18
180912 20
180912 14
180912 40
232459 26
232459 14
232459 51
232459 6
232459 56
406562 11
406562 57
406562 50

I know how to calculate stdev for each partner.

My problem is as follows: I would like to calculate stdev for each line
(inside different partners) in one query. The result should look like this:

customer overdue stdev
180912 18 11,60459679
180912 20 11,60459679
180912 14 11,60459679
180912 40 11,60459679
232459 26 22,15400641
232459 14 22,15400641
232459 51 22,15400641
232459 6 22,15400641
232459 56 22,15400641
406562 11 24,78574859
406562 57 24,78574859
406562 50 24,78574859

Any ideas?
 
T

Tom Lake

Miha said:
Hello!

I have customers in one column and days overdue in another.
I know how to calculate stdev for each partner.

My problem is as follows: I would like to calculate stdev for each line
(inside different partners) in one query. The result should look like
this:

Any ideas?

Use the Domain functions (DSum, etc.) to calculate over the whole set of
data and make that a field in your query.

Tom Lake
 
D

Duane Hookom

You can try use a subquery:

SELECT Customer,
(SELECT StDev(OverDue)
FROM tblYours O
WHERE O.Customer = tblYours.Customer) AS OverDueStDev
FROM tblYours;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top