Michelle Posted September 28, 2020 Share Posted September 28, 2020 (edited) Hi there, Could anyone please help me to combine the below SQL statements such that the result is a 4 column table as shown in my screenshot? /* entire table here */ SELECT AutoNumber, DDAte, Amount FROM LedgerTransactions LT WHERE DDATE >= DATEFROMPARTS(2019,01,01) AND LT.AccNumber IN (select distinct AccNumber FROM LedgerMaster) ORDER BY ddate DESC /* add CoName to above table as 4th column, same value for every row */ select CoName from LedgerParameters Thank you in advance, Michelle Edited September 28, 2020 by Michelle trying to notify myself if reply, cant find it Link to comment Share on other sites More sharing options...
Michelle Posted September 28, 2020 Author Share Posted September 28, 2020 Not to worry thank you, I found the answer: SELECT AutoNumber,DDAte,Amount*(-1) as Amount, (select CoName from LedgerParameters) as Company FROM LedgerTransactions LT WHERE DDATE >= DATEFROMPARTS(2019,01,01) AND LT.AccNumber IN (select distinct AccNumber FROM LedgerMaster) ORDER BY ddate DESC Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now