I have a rather strange problem:
when certain sales are made (completed) a record is inserted with the event and ID of the sales person, currently this table is queried and the 'Count' is used (along with usual date boundaries) to calculate number of 'closed' sales. This is currently working fine.
The problem now is some sales are 'shared' sales, products are linked via leads, usually the lead and the product are always by the same sales person, however in some rare cases lead can be created by on salesperson and the product 'sold' by another in such case the 'sales' calculation needs to award 0.5 (half) a point to each sales person.
What would be the best SQL approach to solve this?
(SQL Server 2005)