Hi there,
Can anybody please help me compiling a basic query?
The query should filter for customers belonging to a certain posting group (Customer table) and then display the customer number along with the current customer balances.
I am not sure how to compile it since I need the data from 2 or maybe 3 tables:
Customer table - To identify the list of customers.
Cust Ledger Entry table - To get the 'Remaining Amount' for each customer. The challenge is that this field is a flowfield in this table and it is based upon entries in the 'Detailed Cust Ledger Entry' table.
Any suggestions or ideas...
Thank you
0
Comments
Just quickly designed query in query designer:
I am sure that this query could be optimized to not read all customers and limit the selection by WHERE clausule instead HAVING etc...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Rudy
'Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "Visions$Detailed Cust_Ledg_ Entry.Amount(LCY)" could not be bound.'
SELECT
[Visions$Customer].No_, [Visions$Customer].Name, [Visions$Customer].[Customer Posting Group],
SUM
([Visions$Detailed Cust_Ledg_ Entry].[Amount(LCY)]) AS Balance
FROM
[Visions$Customer] LEFT OUTER JOIN
[Visions$Detailed Cust_ Ledg_ Entry]
ON
[Visions$Customer].No_ = dbo.[Visions$Detailed Cust_ Ledg_ Entry].[Customer No_]
Thank you
Rudy
There is a "Space" missed in your SUM statemend behind the first "underline".
U wrote "Detailed Cust_Ledg_ Entry". The correct name is: "Detailed Cust_ Ledg_ Entry".
Also u muss set the Space before the (LCY) in your Sum statement. The correct name is: [Amount (LCY)])
And you should use a "group by" statement. Then i'm sure, you need a sum per Customer and Posting group.
Try:
Regards