I have a table with FK customersID and the fields Year (XXXX), Month (values 1 to 12) and amount. Each Customer can have several rows with the same year but different month and amount. Some customers have records for the month 1,2,3,4, but others only month 1,3 and so on.
What I like to do is to have one select Query that groups together to the customers and sum the amount, but only those costomers who have amounts registered in the same months as my spesially selected Customer.
For instance: customerID 34 has an amount in month 2,3, and 5. I what to group the other customers who also (and only) have amounts in the same three months (2,3 and 5).
It should all be done in one single Query from an .asp webpage.
Sverre
What I like to do is to have one select Query that groups together to the customers and sum the amount, but only those costomers who have amounts registered in the same months as my spesially selected Customer.
For instance: customerID 34 has an amount in month 2,3, and 5. I what to group the other customers who also (and only) have amounts in the same three months (2,3 and 5).
It should all be done in one single Query from an .asp webpage.
Sverre