Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello all,


My requirement is, if one user is added 5 members , he will add 1 credit to his credit table. For this i am using memberconnection table in this table columns are
ID, RequieredMemberID, RecipientMemberID, Datecreated, StatusID. I want to find out members(RecipiencememberID's) count using Datecreated column.
Suppose example from todaydate to tommorrow evening i will get 5 members count i want to add 1 credit to another table. from tomorrow evening onwards suppose after
5days i will get 5 members count i want to add another 1 credit just like loop . How count no.of members(ReceipientMemberID).
How i will do this requirement using datecreated column in memberconnection . Please tell me any one.


Thanks
Posted

1 solution

--write a procedure for the below code which takes startdate and enddate as parameter

Declare @startdate datetime;
Declare @enddate datetime;

declare @count int;

select @count=count(*) from memberconnection where Datecreated >=@startdate and Datecreated<=@enddate

if @count>=5
begin
---add credit
end
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900