Logo SQLinForm

 

Re: Separation of Function from its parameters when formatting.

Darren Fitzgibbon
[open] Separation of Function from its parameters when formatting.
September 08, 2010 11:22AM
Can you look at keeping the function and its parameters together instead of splitting them across lines. It is most noticable with formatting for VB String (1)

ie

select BudgetView.BCodeKey
, Bcode.Code as BudgetcodeCode
, Bcode.Description as BudgetcodeDesc
, BudgetView.FinYearKey 
, sum(BudgetView.BudgetAmount) as BudgetAmount
, SUM(Budgetview.CommitmentAmount) as  CommitmentAmount
, SUM(Budgetview.CommitmentAmountPO) as  CommitmentAmountPO
, SUM(Budgetview.InvoiceAmount ) as  InvoiceAmount
, SUM(Budgetview.Outstanding ) as  Outstanding
, Budgetview.CostCodeTypekey
from BudgetView
inner join ACCOUNTCODE Bcode
on budgetview.BCodeKey = Bcode.AccountCodeKey
Group by BudgetView.BCodeKey, Bcode.Code, Bcode.Description ,
BudgetView.FinYearKey, Budgetview.CostCodeTypekey  

having CostCodeTypekey = 1

formats as

sSQL = ""
sSQL = sSQL & "SELECT   BudgetView.BCodeKey, Bcode.Code AS BudgetcodeCode, Bcode.Description "
sSQL = sSQL & "         AS BudgetcodeDesc, BudgetView.FinYearKey, SUM "
sSQL = sSQL & "         (BudgetView.BudgetAmount) AS BudgetAmount, SUM "
sSQL = sSQL & "         (Budgetview.CommitmentAmount) AS CommitmentAmount, SUM "
sSQL = sSQL & "         (Budgetview.CommitmentAmountPO) AS CommitmentAmountPO, SUM "
sSQL = sSQL & "         (Budgetview.InvoiceAmount) AS InvoiceAmount, SUM "
sSQL = sSQL & "         (Budgetview.Outstanding) AS Outstanding, Budgetview.CostCodeTypekey "
sSQL = sSQL & "FROM     BudgetView "
sSQL = sSQL & "         INNER JOIN ACCOUNTCODE Bcode "
sSQL = sSQL & "         ON       budgetview.BCodeKey = Bcode.AccountCodeKey "
sSQL = sSQL & "GROUP BY BudgetView.BCodeKey, Bcode.Code, Bcode.Description, "
sSQL = sSQL & "         BudgetView.FinYearKey, Budgetview.CostCodeTypekey "
sSQL = sSQL & "HAVING   CostCodeTypekey = 1"

Clearly the SUM should be with the field it is acting on.

I have tried this on the latest desktop version and it is still the same



Edited 1 time(s). Last edit at 12/27/2010 01:04PM by guidomarcel.
Re: Separation of Function from its parameters when formatting.
September 08, 2010 11:32PM
Hi,
thanks for your feedback.
Did you set a max line width?

Regards
Guido



Edited 1 time(s). Last edit at 09/08/2010 11:33PM by guidomarcel.
Author:

Your Email (Optional):


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 23 plus 16?
Message: