November 12, 2017 at 4:05 am
Hi
I have 1 Table with field Document Type . I want those records of Customer whose Sum(Amount) of Document Type 4 - Sum(Amount) of Docutype6 > 0
then those records of that Customer whose Document Type in (4,6) should be displayed.
Thanks
November 12, 2017 at 4:12 am
jagjitsingh - Sunday, November 12, 2017 4:05 AMHi
I have 1 Table with field Document Type . I want those records of Customer whose Sum(Amount) of Document Type 4 - Sum(Amount) of Docutype6 > 0
then those records of that Customer whose Document Type in (4,6) should be displayed.
Thanks
Post the DDL (create table) script, sample data as an insert statement, what you have tried so far and the expected results please!
😎
November 12, 2017 at 6:39 am
Without DDL, you're probably looking for using SUM with an OVER clause. Probably inside a CTE. This is all I can guess without DDL:
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
November 12, 2017 at 9:11 pm
jagjitsingh - Sunday, November 12, 2017 4:05 AMHi
I have 1 Table with field Document Type . I want those records of Customer whose Sum(Amount) of Document Type 4 - Sum(Amount) of Docutype6 > 0
then those records of that Customer whose Document Type in (4,6) should be displayed.
Thanks
You've written out the requirements and the seem pretty simple... at least try something on your own.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply