Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL select query columns

$
0
0

Hi Guys,

I created this select query. SELECT GeneralLedger, YEAR(ReportingDate) AS jaar, MONTH(ReportingDate) AS periode, SUM(AmountDCDebit - AmountDCCredit) AS Saldo
FROM dbo.GeneralLedgerBalances
GROUP BY GeneralLedger, YEAR(ReportingDate), MONTH(ReportingDate)
HAVING (YEAR(ReportingDate) = 2020)

SQL
SELECTGeneralLedger,YEAR(ReportingDate)ASjaar,MONTH(ReportingDate)ASperiode,SUM(AmountDCDebit-AmountDCCredit)ASSaldoFROMdbo.GeneralLedgerBalancesGROUPBYGeneralLedger,YEAR(ReportingDate),MONTH(ReportingDate)HAVING(YEAR(ReportingDate)=2020)

The result is this: see attachement "result"


I would like to change my selectquery so the result would end like this: "result mus be"

SQL

Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>