Presentation is loading. Please wait.

Presentation is loading. Please wait.

What you need to build your own SQL Queries Data Connection Server Name Database Name Table and Field Names SQL or Windows (AD) Account Query Tool.

Similar presentations


Presentation on theme: "What you need to build your own SQL Queries Data Connection Server Name Database Name Table and Field Names SQL or Windows (AD) Account Query Tool."— Presentation transcript:

1 What you need to build your own SQL Queries Data Connection Server Name Database Name Table and Field Names SQL or Windows (AD) Account Query Tool

2 Options for Working with IT Read-Only Access Test Server Report Server Database Copy Table Copy TWO Database (Fabrikam) Local GP

3 GP Table Primer (Prefixes) AAAnalytical Accounting ECMEnhanced Commitment Mgmt HRHuman ResourcesPOPPurchase Order Processing AFAdvanced Financial Analysis EDCMLMultilingual Checks IVInventoryPPRevenue Expense Deferrals AHRAdvanced Human Resources EDCVATVAT DaybookIVCInvoicingRMReceivables Management APRAdvanced PayrollEHWEmployee Health and Wellness LKLinked Transactions RVLPPayables Document Management ASISmartList Favorites ENCEncumbrance Management MCMulticurrencySLBSmartList Builder BMBill of MaterialsERBExcel Report Builder MEEFT (Electronic Funds Transfer) SOPSales Order Processing CMCash Management EXTExtenderMXElectronic Signatures Audit Trails SVCField Service DDDirect DepositFAFixed AssetsPAProject Accounting SYSystem or Company DTAMulti-Dimensional Analysis GLGeneral LedgerPMPayables Management UPRUS Payroll

4 GP Table Primer (Table Numbers) 00000 – Master Tables 10000 – Work Tables 20000 – Open Tables 30000 – History Tables 40000 – Setup Tables 50000 – Temp Tables 60000 – Relation Tables 70000 – Report Options Tables 80000 – Posting Journal Reprint Tables 90000 – Miscellaneous Tables

5 Commonly Used Tables – General Ledger GL00100 – Chart of Accounts GL00201 – Budget and Forecast Data GL10110 – Open Year Summary Table GL10111 – Closed Year Summary Table GL20000 – Open Year Transaction Detail GL30000 – Closed Year Transaction Detail Key Fields: ACTINDX

6 Commonly Used Tables – Payables Management PM00200 – Vendor Master Table PM30200 – PM Paid Transaction History Table PM30300 – PM Apply To History Table PM30600 – PM Distribution History Table Key Fields: VENDORID, DOCNUMBR and DOCTYPE

7 Commonly Used Tables – Receivables Management RM00101 – Customer Master Table RM20101 – RM Open Table RM20201 – RM Apply Open Table RM30101 – RM History Table RM30201 – RM Apply History Table Key Fields: CUSTNMBR, DOCNUMBR and RMDTYPAL

8 SQL Select Statement Structure Keyed OrderProcessing Order SELECTFROM WHERE GROUP BY HAVING SELECT ORDER BY

9

10 Mike’s Top 5 SQL Functions TOP SELECT TOP 25 * FROM RM00101 COUNT SELECT COUNT(*) FROM RM20101 RTRIM SELECT RTRIM(CUSTNMBR), CUSTNAME FROM RM00101 SUBSTRING SELECT CUSTNMBR, CUSTNAME, SUBSTRING(ZIP,1,5) FROM RM00101 IIF SELECT CUSTNMBR, CUSTNAME, IIF(STATE = 'CA', 'CAL', 'Not-CAL') AS STATE_TYPE FROM RM00101

11 Mike’s Tools and Resources Information Flow and Posting Richard Whaley – Accolade Publications www.accoladepublications.comwww.accoladepublications.com Developing Microsoft Dynamics GP Business Applications Leslie Vail – PACKT Publising Mark Polino’s Excel Based Table and Field Reference https://app.box.com/s/8c0prp7widr81bc69w84 MSSQL Deep Search http://www.gp-dynamics.com spSearchOnAllDB http://blogs.msdn.com/b/developingfordynamicsgp/archive/2008/12/01/spsearchonalldb-sql-stored-procedure-to- search-an-entire-database.aspx SQL Server Central (Stairway Series) www.sqlservercentral.com Microsoft Dynamics GP – Resource Descriptions

12 Build a query in Excel 1.Identify in the UI what data you are looking for a)Let’s look at a GL account using Summary – Freight and Handling b)We want detail trx for this account to analyze who we spent our money with 2.Since GP uses an index for the account number in the trx tables, we first need to identify the index for the account we want 3.Note: All of the commands below were built using the TWO database in the Fabrikam test company for GP. Most will work on your system…but you might need to add or subtract the Account Number segments. Also, the account index you want to look at would change as well. 4.Build a query of the COA Master a)Create connection string b)SELECT * from GL00100

13 Build a query in Excel 4.We want the transactions for account index 142 5.Build a query of ALL trx for that index a)Build connection string b)SELECT * FROM GL20000 WHERE ACTINDX=142 6.This looks good, but it’s got more information in it than we need a)We need to select only the columns we need b)SELECT JRNENTRY, REFRENCE, TRXDATE, ORMSTRID,ORMSTRNM, ORDOCNUM, DEBITAMT, CRDTAMNT FROM GL20000 WHERE ACTINDX=142

14 Build a query in Excel 7.We might want to include the account name and the account number components in our data. To do that we need to join in the COA master a)SELECT JRNENTRY, REFRENCE, TRXDATE, ORMSTRID,ORMSTRNM, ORDOCNUM, DEBITAMT, CRDTAMNT, ACTNUMBR_1, ACTNUMBR_2, ACTNUMBR_3, ACTDESCR FROM GL20000 LEFT JOIN GL00100 ON GL20000.ACTINDX=GL00100.ACTINDX WHERE GL20000.ACTINDX=142 b)Note the addition of the GL20000. to the Where statement i.Since ACTINDX exists in both tables, you must specify which one you want ii.For the SELECT portion, you might need to specify using this syntax as well if your query is more complicated. 8.Now that you have a working data set, you can pass it to a pivot table and make some sense out of it

15 Build a query in Excel 9.What might our next steps be? a)Add more accounts to the query. Let’s add Contract Services, index 270 b)SELECT JRNENTRY, REFRENCE, TRXDATE, ORMSTRID,ORMSTRNM, ORDOCNUM, DEBITAMT, CRDTAMNT, ACTNUMBR_1, ACTNUMBR_2, ACTNUMBR_3, ACTNUMBR_4, ACTDESCR FROM GL20000 LEFT JOIN GL00100 ON GL20000.ACTINDX=GL00100.ACTINDX WHERE GL20000.ACTINDX=142 OR GL20000.ACTINDX=270


Download ppt "What you need to build your own SQL Queries Data Connection Server Name Database Name Table and Field Names SQL or Windows (AD) Account Query Tool."

Similar presentations


Ads by Google