i have been asked to do trhis
Expiry Date are equal
Portfolio/Clearer are equal
Tax Lot/Transaction Code – one record has Buy, the other SellShort
Instr/Instrument are equal
Instr/insaddr are equal
Portfolio/PB Account Number are equal
Tax Lot/Quantity – netting (summing) these across the 2 records results in Zero
i did up a quick select query to find the records first but getting an error on the sum. what do i do to get the query working.
Select * from dbo.HegdeServWorkingTaxLotTableName where [Instr_Expiry Date] = [Instr_Expiry Date] and Portfolio_Clearer = Portfolio_Clearer and Instr_Instrument = Instr_Instrument and Instr_nsaddr = Instr_nsaddr and [Portfolio_PB Account Number] = [Portfolio_PB Account Number] and [Tax Lot_Transaction Code] = 'Buy' or [Tax Lot_Transaction Code] = 'SellShort' and SUM([Tax Lot_Quantity]) = '0'