Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Query

Hi All,

I am trying to get a summary query for all invoices and credit notes per branch.

Select [Branch], [Total Invoices] from

(Select case

when Series = '1' then 'DBN'

when Series = '2' then 'CPT'

when Series = '66' then 'JHB'

when Series = '67' then 'LKW'

Else 'PLZ' end [Branch],

DocTotal

from OINV ) A

Pivot

(sum(Doctotal) for [Branch] in ([Total Invoices])) as PVT

I get a syntax error

Msg 207, Level 16, State 1, Line 1

Invalid column name 'Branch'.

How do i correct this?

How do i incorperate the credit notes into this query?

Thanks,

Kiran

Former Member
Not what you were looking for? View more on this topic or Ask a question