web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Displaying a table named CheckRegister

(0) ShareShare
ReportReport
Posted on by 205
So I wanted to make an SQL Query where it shows the data in one table this is the data needed, VNDCHKNM from PM00200,VCHRNMBR,DOCDATE,DOCNUMBR,DOCAMNT,TRXDSCRN,VOIDED,CHECKBKID,PPSAMDED from PM20000 and PM30200, TXTFIELD from SY03900, along with APTODCNM,APTODCDT,APPLDAMT,WROFAMNT,DOCTYPE,DISTKNAM, APFRDCNM,APTVCHNM from PM10200. Im having problems with creating the query especially with the TXTFIELD It doesn't seem to be displaying some records with a note from inside SY03900

*This post is locked for comments

I have the same question (0)
  • L Vail Profile Picture
    65,271 on at

    Hi,

    You need to do a SQL union. Could you post the Query that's not working for you?

    Leslie

  • ogmarvin21 Profile Picture
    205 on at

    Actually I think its working now this is my new Query you were right it was a UNION that I needed

    CREATE VIEW dbo.CheckRegRp2t

    AS

    SELECT    dbo.PM00200.VNDCHKNM, dbo.PM20000.VCHRNMBR, dbo.PM20000.DOCDATE,dbo.PM20000.DOCNUMBR, dbo.PM20000.DOCAMNT,

    dbo.PM20000.TRXDSCRN,dbo.PM20000.VOIDED, dbo.PM20000.CHEKBKID,dbo.PM20000.PPSAMDED, dbo.SY03900.TXTFIELD, dbo.PM20100.APTODCNM,

    dbo.PM20100.APTODCDT,dbo.PM20100.APPLDAMT,dbo.PM20100.WROFAMNT, dbo.PM20100.DOCTYPE,dbo.PM20100.DISTKNAM, dbo.PM20100.APFRDCNM,

    dbo.PM20100.APTVCHNM

    FROM dbo.PM00200

    INNER JOIN dbo.PM20000

    ON dbo.PM00200.VENDORID = dbo.PM20000.VENDORID

    INNER JOIN dbo.SY03900

    ON dbo.SY03900.NOTEINDX = dbo.PM20000.NOTEINDX

    INNER JOIN dbo.PM20100

    ON dbo.PM20000.VCHRNMBR = dbo.PM20100.VCHRNMBR

    UNION ALL

    SELECT    dbo.PM00200.VNDCHKNM, dbo.PM30200.VCHRNMBR,dbo.PM30200.DOCDATE,dbo.PM30200.DOCNUMBR, dbo.PM30200.DOCAMNT,

    dbo.PM30200.TRXDSCRN,dbo.PM30200.VOIDED, dbo.PM30200.CHEKBKID, dbo.PM30200.PPSAMDED,dbo.SY03900.TXTFIELD, dbo.PM30300.APTODCNM,

    dbo.PM30300.APTODCDT, dbo.PM30300.APPLDAMT,dbo.PM30300.WROFAMNT, dbo.PM30300.DOCTYPE,dbo.PM30300.DISTKNAM, dbo.PM30300.APFRDCNM,

    dbo.PM30300.APTVCHNM

    FROM dbo.PM00200

    INNER JOIN dbo.PM30200

    ON dbo.PM00200.VENDORID = dbo.PM30200.VENDORID

    INNER JOIN dbo.SY03900

    ON dbo.SY03900.NOTEINDX = dbo.PM30200.NOTEINDX

    INNER JOIN dbo.PM30300

    ON dbo.PM30300.APTODCNM = dbo.PM30200.VCHRNMBR

  • ogmarvin21 Profile Picture
    205 on at

    I seem to have a new problem, Im using crystal reports and connected the table I made to this particular report, I successfully dragged all my fields into the report, the VNDCHKNM, DOCTYPE, etc... and they are all displaying in my report.

    Heres my problem when in Visual Basic, when I click a button of mine that shows the report all of the fields are correctly displayed except for TXTFIELD which is a memo field it just shows an empty space with no text.

    Here is my code

       rsCheck.Open "SELECT * from CheckRegRp2t where DOCDATE between '" & strStartDate & "' and '" & strEndDate & "' " & _

                   " order by apfrdcnm ", gconPGCI

       Set crystal = New CRAXDRT.Application

       Set report = crystal.OpenReport("D:\Great-Plains Reports\Reports\rptCheckRegister.rpt")

       strmontha = Val(strmonth)

       report.DiscardSavedData

       report.ReportTitle = " CHECK REGISTER FOR " & MonthName(strmonth) & " " & intYear & " "

       report.Database.SetDataSource rsCheck          

       crptCheck.ReportSource = report            

       crptCheck.ViewReport                  

       rsCheck.Close

  • Suggested answer
    soma Profile Picture
    24,410 on at

    Have you tried to run the above query in SQL server?

    For example:

    Select *From dbo.CheckRegRp2t where DOCDATE between 'Enter start date' and 'Enter end date'

    If the query is not return any values for the column TXTFIELD, check the same column value in the table SY03900 for the particular document.

    Hope this helps!!!

  • Verified answer
    ogmarvin21 Profile Picture
    205 on at

    I solved it by converting the TXTFIELD to a varchar, it seems that VB has problems displaying text data type or memo

    this was the code

    CREATE VIEW dbo.CheckRegRp2t

    AS

    SELECT    dbo.PM00200.VNDCHKNM, dbo.PM20000.VCHRNMBR, dbo.PM20000.DOCDATE,dbo.PM20000.DOCNUMBR, dbo.PM20000.DOCAMNT,

    dbo.PM20000.TRXDSCRN,dbo.PM20000.VOIDED, dbo.PM20000.CHEKBKID,dbo.PM20000.PPSAMDED, CONVERT(VARCHAR(4000),dbo.SY03900.TXTFIELD) AS TXTFIELD, dbo.PM20100.APTODCNM,

    dbo.PM20100.APTODCDT,dbo.PM20100.APPLDAMT,dbo.PM20100.WROFAMNT, dbo.PM20100.DOCTYPE,dbo.PM20100.DISTKNAM, dbo.PM20100.APFRDCNM,

    dbo.PM20100.APTVCHNM

    FROM dbo.PM00200

    INNER JOIN dbo.PM20000

    ON dbo.PM00200.VENDORID = dbo.PM20000.VENDORID

    INNER JOIN dbo.SY03900

    ON dbo.SY03900.NOTEINDX = dbo.PM20000.NOTEINDX

    INNER JOIN dbo.PM20100

    ON dbo.PM20000.VCHRNMBR = dbo.PM20100.VCHRNMBR

    UNION ALL

    SELECT    dbo.PM00200.VNDCHKNM, dbo.PM30200.VCHRNMBR,dbo.PM30200.DOCDATE,dbo.PM30200.DOCNUMBR, dbo.PM30200.DOCAMNT,

    dbo.PM30200.TRXDSCRN,dbo.PM30200.VOIDED, dbo.PM30200.CHEKBKID, dbo.PM30200.PPSAMDED,CONVERT(VARCHAR(4000),dbo.SY03900.TXTFIELD) AS TXTFIELD, dbo.PM30300.APTODCNM,

    dbo.PM30300.APTODCDT, dbo.PM30300.APPLDAMT,dbo.PM30300.WROFAMNT, dbo.PM30300.DOCTYPE,dbo.PM30300.DISTKNAM, dbo.PM30300.APFRDCNM,

    dbo.PM30300.APTVCHNM

    FROM dbo.PM00200

    INNER JOIN dbo.PM30200

    ON dbo.PM00200.VENDORID = dbo.PM30200.VENDORID

    INNER JOIN dbo.SY03900

    ON dbo.SY03900.NOTEINDX = dbo.PM30200.NOTEINDX

    INNER JOIN dbo.PM30300

    ON dbo.PM30300.APTODCNM = dbo.PM30200.VCHRNMBR

  • soma Profile Picture
    24,410 on at

    If your problem has been solved, please mark it as verified. Because this will helps to some others who having the same case.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans