I just ran a cntrl K + Y and this is what I got
SELECT tst.TransId
,tst.TransType
,tst.Invoice
,tst.OrgId
,tst.IndId
,tst.PUB
,tst.Media
,tst.TransDate
,tst.Amount
,tst.GST
,tst.Reconciled
,tst.Void
,SUM(tst.Amount) OVER () AS MTotal
,SUM(tst.GST) OVER () AS GSTTotal
FROM [subscriptions].[dbo].[tblSubsTrans]
AS tst
WHERE MONTH(tst.TransDate) = 7
AND YEAR(tst.TransDate) = 2010
AND tst.GST > 0
AND tst.Void = 0
ORDER BY tst.Invoice
,tst.IndId
,tst.PUB
I expected:
SELECT tst.TransId
,tst.TransType
,tst.Invoice
,tst.OrgId
,tst.IndId
,tst.PUB
,tst.Media
,tst.TransDate
,tst.Amount
,tst.GST
,tst.Reconciled
,tst.Void
,SUM(tst.Amount) OVER () AS MTotal
,SUM(tst.GST) OVER () AS GSTTotal
FROM [subscriptions].[dbo].[tblSubsTrans]
AS tst
WHERE MONTH(tst.TransDate) = 7
AND YEAR(tst.TransDate) = 2010
AND tst.GST > 0
AND tst.Void = 0
ORDER BY tst.Invoice
,tst.IndId
,tst.PUB
If I remove the two SUM fields, I get the expected indentation. I hope indenting shows up in this post.
SELECT tst.TransId
,tst.TransType
,tst.Invoice
,tst.OrgId
,tst.IndId
,tst.PUB
,tst.Media
,tst.TransDate
,tst.Amount
,tst.GST
,tst.Reconciled
,tst.Void
,SUM(tst.Amount) OVER () AS MTotal
,SUM(tst.GST) OVER () AS GSTTotal
FROM [subscriptions].[dbo].[tblSubsTrans]
AS tst
WHERE MONTH(tst.TransDate) = 7
AND YEAR(tst.TransDate) = 2010
AND tst.GST > 0
AND tst.Void = 0
ORDER BY tst.Invoice
,tst.IndId
,tst.PUB
I expected:
SELECT tst.TransId
,tst.TransType
,tst.Invoice
,tst.OrgId
,tst.IndId
,tst.PUB
,tst.Media
,tst.TransDate
,tst.Amount
,tst.GST
,tst.Reconciled
,tst.Void
,SUM(tst.Amount) OVER () AS MTotal
,SUM(tst.GST) OVER () AS GSTTotal
FROM [subscriptions].[dbo].[tblSubsTrans]
AS tst
WHERE MONTH(tst.TransDate) = 7
AND YEAR(tst.TransDate) = 2010
AND tst.GST > 0
AND tst.Void = 0
ORDER BY tst.Invoice
,tst.IndId
,tst.PUB
If I remove the two SUM fields, I get the expected indentation. I hope indenting shows up in this post.