Solved

AP & AR module query

Posted on 2004-04-27
5
2,387 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
ID: 10936070
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
ID: 10937139
Plz explain your both tables structure

From,
 Syed Faisal
0
 

Author Comment

by:manojgh
ID: 10948905
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
ID: 11025494
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need a replacement data type in Oracle 6 77
Question about consuming GB from Comcast 5 54
Powershell script 13 101
Connecting to multiple databases to create a Dashboard 5 25
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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…

770 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