Could you help me how would I use UNION All here please as like to see the data in this form so I can call the SQL view in excel
SupplierCode, PropCode, LettingFee, Rent Received, SupplierPayment, Repaircost, Month, Year
Hope the below is correct
select SupplierCode, PROP_CODE As PropCode, ISNULL(Null,0) As LettingFee, ISNULL(Null,0) As RentReceived, TotalPayment as SupplierPayment, ISNULL(Null,0) As RepairCost, Month, Year
FROM suppliertable
Union All
select [Supplier Code], PROP_CODE, TRANS_AMOUNT, isNull(Null,0), isNull(Null,0),isNull(Null,0), Month, Year from lettingtable
Union All
select SupplierCode, [Prop Code], isNull(Null,0), Total, isNull(Null,0),isNull(Null,0), Month, Year from customerpaymenttable
Union All
select SupplierCode, PROP_CODE, isNull(Null,0),isNull(Null,0),isNull(Null,0), (AMOUNT-VAT_AMOUNT) as RepairCost, Month, Year from repairtable
Regards,
J.Singh
-
Edited by
jaggy99
Saturday, January 31, 2015 7:15 AM