Hi; all
I have a table with four fields:
Fields: name month days monthlysalary
Records: jack 1 15 10000
jack 2 30
20000
jim 1 3
10000
jim 2 30
20000
I want to get the sum of salary for 15 days of month 1 and 30 days of month
2 for jack that results 25000 . (15/30 days*10000+30/30 days*20000)
For jim 3 days of month 1 and 30 days of month 2 that results 21000 . (3/30
days*10000+30/30 days*20000)
How can I do through VBA?
thanks for help
David F Cox - 27 Sep 2006 20:37 GMT
Why VBA when a query can do it?
SELECT Table1.empname, Sum([workdays]*[salary]/30) AS earned
FROM Table1
GROUP BY Table1.empname;
I have not put in any where clauses to restrict the months to 1 and 2
> Hi; all
> I have a table with four fields:
[quoted text clipped - 14 lines]
> How can I do through VBA?
> thanks for help