Code: Select all
declare
@Cycle int = 42;
BEGIN
SELECT FI.this, FI.that
, RI.SomethingElse / FIT.ADivisor,
fi.MoreData
from FInvoice FI left join RInfo RI on RI.id = FI.fi_id
and RI.ACode = FI.ACode
join FITypes FIT on FIT.ACode = FI.ACode and FIT.TypeCode = FI.TypeCode
where (FI.CountryISOCode in ('ABC'))
or (FIT.VAT_Split = 1)
and Cycle = @Cycle
;
END
The following is what results after pressing FORMAT. Please note the WHERE condition.
Code: Select all
declare
@Cycle int = 42;
begin
select
FI.this,
FI.that,
RI.SomethingElse / FIT.ADivisor,
fi.MoreData
from
FInvoice FI
left join RInfo RI
on RI.id = FI.fi_id
and RI.ACode = FI.ACode
join FITypes FIT
on FIT.ACode = FI.ACode
and FIT.TypeCode = FI.TypeCode
where
(FI.CountryISOCode in ('ABC'))
or (FIT.VAT_Split = 1)
and Cycle = @Cycle
;
end
Code: Select all
where
(FI.CountryISOCode in ('ABC')) or
(FIT.VAT_Split = 1) and
Cycle = @Cycle
I need this kind of formatting also with the ON clauses in my JOIN queries as some of our scripts are very complex and difficult to read.
So, have I made the correct settings to do this, or is there truly an issue with the formatter?