Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Calculate Balance with SQL

Posted on by 480

Hi,

Can anyone help me please ,I want to calculate the flowfield Balance of the table Vendor with SQL but really I didn't know how.

thnks in advance 

*This post is locked for comments

  • Suggested answer
    Saurabh Shah Profile Picture
    Saurabh Shah 4,560 on at
    RE: Calculate Balance with SQL

    Hi,

    Balance (LCY) comes from the same detailed vendor ledger entry table and field name is "Amount (LCY)". you can use the same criteria to get this field amount.

    Regards,

    Saurabh Shah

  • ghada Profile Picture
    ghada 480 on at
    RE: Calculate Balance with SQL

    In the report Vendor-Detail Trial Balance (304) there are three columns :Amount/Remaining Amount /Balance(LCY) . I calculated the Amount and the remaining amount ,now I need to calculate the last column with sql.

    thnks,

  • Suggested answer
    Saurabh Shah Profile Picture
    Saurabh Shah 4,560 on at
    RE: Calculate Balance with SQL

    Do you mean to have a opening balance , current balance and closing balance?

    if it is like that then you need to add filter on posting date of detailed vendor ledger entry.

    Let me know your details if finding any thing more.

    Regards,

    Saurabh Shah

  • ghada Profile Picture
    ghada 480 on at
    RE: Calculate Balance with SQL

    thanks for ur answer,

    sorry I wasn't accurate, I wanna calculate the different values of Balance wich appears in the report Vendor-detail trial balance .

    thnks

  • Suggested answer
    Saurabh Shah Profile Picture
    Saurabh Shah 4,560 on at
    RE: Calculate Balance with SQL

    Hi ,

    Please find below script for your reference:

    select [Vendor No_] ,SUM([Amount])as Amount,[Currency Code] , SUM([Amount (LCY)]) as LCY  from [CRONUS USA, Inc_$Detailed Vendor Ledg_ Entry] group by [Vendor No_] , [Currency Code]

    Here "CRONUS USA, Inc_" is the company name.

    Regards,

    Saurabh Shah

  • Suggested answer
    Saurabh Shah Profile Picture
    Saurabh Shah 4,560 on at
    RE: Calculate Balance with SQL

    Hi,

    Balance field of Vendor table is the sum of "Amount" field from the "Detailed Vendor Ledg. Entry" table.

    Filters are Vendor number , Global dimension 1, Global dimension 2 and Currency Code.

    Regards,

    Saurabh Shah

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans