May 15, 2013 at 2:03 am
Hi,
Please help me with this :
I need to take count of investors invested and having balance in Funds:1,2,3,4,5,6,7,8 by date 12-03-2010
I have following tables:
aao_Fund_AJ ,Its Columns are : FId,FName
aao_Balance_Aj ,its columns are :balance,holder,date
May 15, 2013 at 3:16 am
That will help to start getting relevant help:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
May 15, 2013 at 6:54 am
Reading the link Eugene provided will definitely help get better answers but here's something that I hope will help:
Select
Count(I.investorid) as investors,
F.fundID
From
funds as F
join investments as I
on F.fundid = I.fundid
Where
F.fundid in (1,2,3,4,5,6,7,8) and
I.investmentdate <= 12-03-2010
Group By
F.fundid
/* this eliminates investors that don't have a balance and assumes
that investments and withdrawals are in the investments table and
will 0 each other out because a withdrawal is a negative */
Having
Sum(I.investmentamount) > 0
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply