Formating not correct when using OVER()

Provides intelligent code completion for SQL Server editors.

Moderators: David Atkinson, Anu Deshpande, Luke Jefferson

Formating not correct when using OVER()

Postby Random Lengths » Tue Aug 17, 2010 6:02 pm

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.
Random Lengths
 
Posts: 27
Joined: Mon Sep 29, 2008 11:02 pm
Location: Eugene, OR

Postby Anu Deshpande » Thu Aug 19, 2010 10:21 am

Many thanks for your post.

As per your post and your email I think you are using SQL Prompt 4.0.4.11

Can you kindly install the latest patch version of SQL Prompt from here?

Kindly let me know if this fixes the issue.
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge

Didn't work

Postby Random Lengths » Thu Aug 19, 2010 4:26 pm

I downloaded and installed 4.0.4.23.

No change in behavior.

The issue is not resolved.

Dan
Random Lengths
 
Posts: 27
Joined: Mon Sep 29, 2008 11:02 pm
Location: Eugene, OR


Return to SQL Prompt Previous Versions

Who is online

Users browsing this forum: No registered users and 1 guest