Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 join two tables
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

67 Posts

Posted - 11/16/2007 :  12:36:57  Show Profile  Reply with Quote
select * from dbo.FundTransactionLines where postingdate = '2007-11-01'

select * from subaccountcurrentholdings

i only need totalshares from subaccountcurrentholdings and I need everything from fundtransactionlines

they both have accountnumber and FundId in common

want this displayed as 1


Posting Yak Master

185 Posts

Posted - 11/16/2007 :  12:47:45  Show Profile  Reply with Quote
fields and a good definition of the desired results would be more helpful, here is a guess from the limited information...
select *
from dbo.FundTransactionLines
left join
select fundid, sum(shares) as totalshares
from dbo.subaccountcurrentholdings
group by fundid
) as totalshares
on totalshares.fundid = dbo.FundTransactionLines.fundid
where dbo.FundTransactionLines.postingdate = '2007-11-01'
Go to Top of Page

Yak Posting Veteran

67 Posts

Posted - 11/16/2007 :  13:56:38  Show Profile  Reply with Quote

so I need AccountNumber, FundId, ProcessingDateTime, TransactionID, CustomTransactionCode, TradeDate, PricerPerShare, GrossAmount, NetAmount, ShareAmount, FeeAmount

from Table: FundTransactionLines

then I want to add TotalShares from the SubAccountCurrentHoldings table based on AccountNumber and Fundid from transactionLines table.

also I need it where FundTransactionLines.postingdate = '2007-11-01'

Edited by - QuietRiot on 11/17/2007 13:21:56
Go to Top of Page

Yak Posting Veteran

67 Posts

Posted - 11/17/2007 :  13:22:53  Show Profile  Reply with Quote
I edited the above to make more sense. Any help?

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000