Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

SQL Querry

Posted on by Microsoft Employee

Hello, I need to build a SSRS report where I can generate Historical Trial Balance for a particular Vendor. I was just wondering if anyone has written the SQL query for this.

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: SQL Querry

    Hi Sattu,

    Already this report was available in GP, Report > Purchasing > Trail Balance > Historical Aged Trail Balance and if you deployed std SSRS report from reporting tools setup then you can find those report in Your Company > Purchasing > Historical Aged Trail Balance mentioned by Tom & the precise view by harry.

    Did you need anything advanced with this report ?

  • Suggested answer
    Redbeard Profile Picture
    Redbeard 12,931 on at
    RE: SQL Querry

    Not your problem - totally mine.  I misread your post.

    Tom has identified the reports you can use for this purpose.  

    Victoria Yudin's blog has some really good table information on SQL views for all the financial modules.

    victoriayudin.com/.../sql-view-for-current-payables-aging-detail-in-dynamics-gp

  • Suggested answer
    Tom Cruse Profile Picture
    Tom Cruse 1,475 on at
    RE: SQL Querry

    See this report already exists, I don't understand why you're trying to create what already exists.

     

  • sattty Profile Picture
    sattty on at
    RE: SQL Querry

    I am sorry, I think I did not make the question clear. I meant Historical Aged Trial balance for a vendor

  • Suggested answer
    Redbeard Profile Picture
    Redbeard 12,931 on at
    RE: SQL Querry

    There are three basic HITB reports, which deploy with the standard Dynamics GP SSRS reports.  Goto SSRS Home > Company > Inventory - The all have HITB in their names.

    I am not sure exactly what you need to see for a particular vendor, but here's a foundation query for HITB I happen to have laying around:

    --Reports sum by item # for HITB (All HITB Activity)

    Declare @ReportStartDate varchar(10)

    Declare @ReportStopDate varchar(10)

    Set @ReportStartDate = '2012-02-01'

    Set @ReportStopDate = '2012-02-29'

    select

    rtrim(hi.ITEMNMBR) Item_Number,

    rtrim(im.ITEMDESC) Item_Description,

    sum (hi.TRXQTYInBase) Quantity,  --Transaction Quantity for this transaction in Base Units of Measure

    sum (hi.EXTDCOST) Extended_Value  --The Extended Cost from the HITB table

    from dbo.SEE30303 hi (NOLOCK) --HITB Table (holds all transaction date for Historical Aged Trial Balance Reporting)

    LEFT JOIN IV00101 im (NOLOCK) ON hi.itemnmbr = im.itemnmbr --Joining this table provides Link to Item Description

    where hi.GLPOSTDT between '@ReportStartDate' and @ReportStopDate --Date Range

    group by hi.ITEMNMBR, im.ITEMDESC

    order by hi.ITEMNMBR

    ---------

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: SQL Querry

    can you please send me the query script please, thanks

  • Suggested answer
    Tom Cruse Profile Picture
    Tom Cruse 1,475 on at
    RE: SQL Querry

    I believe one of the stock SSRS reports that get deployed for GP have this report in it.

    I might be wrong but I'm about 99% sure. I'm in the middle of updating my servers right now so I'm not able to look at the moment.

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans