In SQL, 5 members are register the 1st member will refer the other 4 so we put commision as
1st member got-50%
other 4 members got-10%
how i calculate it?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bhabani prasad DashPosted May 15, 2013, 2:57 AM
Pardeep MalikPosted May 12, 2012, 2:02 AM
you can create a trigger or store procedure for that
Let we have a table to insert amount to the table of customer and as you enter the amount value also reflects to commission table.
as
create trigger com1 on custmor for insert
as
declare @amt float
select @amt=amount from inserted ----amount is the column for inserting amount in customer table
declare @m1com float
declare @m2com float
declare @m3com float
declare @m4com float
declare @m5com float
set @m1com=@amt*50/100 ---Calculating commission for 1st memeber
set @m2com=@amt*10/100
set @m3com=@amt*10/100---Calculating commission for other memebers
set @m4com=@amt*10/100
set @m5com=@amt*10/100
inset into commission1 values(.....,@m1com,@m2com,@m3com,@m4com,@m5com,....) ---adding commission of memebers with other values in table
Note - Trigger automatically called when value is ineserted
Muhammad Shahid FarooqPosted May 12, 2012, 2:01 AM
Kunal VaishyaPosted May 12, 2012, 1:54 AM