Hi
I have below query but it is giving error when i write this line
(Select sum([Amount]) from [dbo].[Test1$Detailed Vendor Ledg_ Entry]
where [Vendor Ledger Entry No_] = v.[Entry No_] and [Posting Date] = v.[Posting Date] ) as OlAmt
Column 'Test$Vendor Ledger Entry.Entry No_' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
SELECT v.[Posting Date],v.[Document Type],v.[Document No_],v.Description,v.[Currency Code],(Select sum([Amount]) from [dbo].[Test1$Detailed Vendor Ledg_ Entry]
where [Vendor Ledger Entry No_] = v.[Entry No_] and [Posting Date] = v.[Posting Date] and [Entry Type] = 1) as OriginalAmt
FROM [Test0$Vendor Ledger Entry] v
inner join
[Test1$Detailed Vendor Ledg_ Entry] d
on d.[Vendor Ledger Entry No_] = v.[Entry No_]
group by v.[Posting Date],v.[Document Type],v.[Document No_],v.Description,v.[Currency Code]
*This post is locked for comments