I have a form in my windows application(VS-2008 c#), where i need to retrieve sum(amount) and name for selected users, where each user might have multiple transactions,
this is the query i was using for this:
Select txt_name as Name,
SUM(double_net_amt) as Amount
from match_transaction
where int_user_id IN (" + user_list + ") group by txt_name
but now i am expected to check the sum(amount) value and add it to a datagridview1 if it is positive, else add it to DGV2 if it is negative,
so with the group by clause, i can’t figure out a way to do it, please help me…..:P/
thanxx in advance =)
A separate query for each grid, and alter each query to use
HAVING SUM(double_net_amount) > 0(or < 0).Like so: