Home Transact SQL - Table with different Record types requiring calculation
Reply: 0

Transact SQL - Table with different Record types requiring calculation

user816
1#
user816 Published in June 19, 2018, 6:19 pm

I have a table of invoices and Record_Types that I need to reconcile to open invoice report. I have the process down and know what I need to do. Just dont know how to properly structure the query and would prefer to not create 3 tables. Record Types.

  • Invoice = 1 Credit = 5 Payment = 7

Invoice_Number, Record_Type, Dollar figure

Outstanding_Balance = Invoice(1) -(Payment(7)-(Credit))

Invoice_number Record_type Gen_Numeric_3

Basically I need to take the record_Type 1 and subtract the total of record type 7's from the below.

Invoice_Num Rec_Type Dollar_Amt    
00820437      1     536.7700000000  
00820437      7     469.6200000000  
00820437      7      67.1500000000  

Any advice would be great. messer

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.326458 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO