Solved

AP & AR module query

Posted on 2004-04-27
5
2,341 Views
Last Modified: 2012-06-27
I need a query of the following:

Invoices generated in December 1  through March 1
 
Based on a ship to of:
New Jersey
Texas

The query should contain the following:
Invoice Number
Date
G/L Tax Liability Account
Amount of Invoice
Amount of Tax charged

Can somebody pls help me getting this query done. I'm getting Invoice ID, Amount and Date from AP_INVOICES_ALL,  i hope "ship to" will come from "RA_CUSTOMERS", but donno how to join them. Am I looking into correct tables.

Your help is appreciated.
webservices23@yahoo.com


0
Comment
Question by:manojgh
5 Comments
 

Expert Comment

by:phake123
Comment Utility
show your table relations  (the columns for AP_INVOICES_ALL and RA_CUSTOMERS)

Im making a few assumption but you can apply the changes yourself or ask again

SELECT a.[Invoice Number], a.[Date], a.[Acct], a.[Invoice Amount], a.[Tax Amount], b.[CustomerID], b.[City]
FROM  AP_INVOICES_ALL as a INNER JOIN RA_CUSTOMERS as b
ON a.CustomerID = b.CustomerID
WHERE (b.date between #12/01/03# and #3/1/03#) and (b.city = 'New Jersey' or b.city ='Texas')


The code above assumes the CustomerID column are both present in the RA_CUSTOMER, AP_INVOICES_ALL table.  They are both linked as one-to-many relation.  The query will pull out all invoices related to a customer and where the customers city is either "new jersey" or "texas".  It also narrows the data down more by only selected the records where the invoice date is between 12/01/03 - 3/1/03

-Mike
0
 

Expert Comment

by:sydfaisal
Comment Utility
Plz explain your both tables structure

From,
 Syed Faisal
0
 

Author Comment

by:manojgh
Comment Utility
Thanks Mike.

I'm sorry about the way the Question was put. This Query has to come only from AR module of Oracle Apps 11i. So, the AP_INVOICES_ALL will NOT come in the picture. I'm using APPS.RA_CUSTOMER_TRX A, APPS.RA_CUSTOMER_TRX_LINES B
, APPS.RA_CUST_TRX_LINE_GL_DIST C, APPS.RA_COSTOMERS D.

Let me know if you have any questions.



0
 
LVL 1

Accepted Solution

by:
arora_ashish earned 50 total points
Comment Utility
Manoj,

If you are matching invoice with PO then you can join ap_invoice_distributions_all with po_distributions_all on po_distribution_id column and po_distributions_all table with po_line_locations_v on line_location_id.

In the where clause you can put WHERE po_line_locations_v.SHIP_TO_LOCATION_CODE  in( <your location codes>)

GL_JE_LINES can also be joined to ap_invoice_distributions_all.


Hope this helps

Regards,
Ashish




0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now