on 01-14-2010 10:25 AM
Hi,
Is there any relation between OINV and ORIN tables?
I can see in ORIN table, field Comments, a description of this, but I need to do a query with a relation and this field is invalid for to do this transaction.
Thanks in advance!!!
Hi Cristina,
Not between OINV and ORIN, but there is a relationship between INV1 and RIN1.
Here is the SQL to return all the Invoices that had at leat one row converted to a credit memo.
SELECT DISTINCT
T3.DocNum AS 'Invoice Number', T3.DocDate AS 'Invoice Date',
T0.DocNum AS 'Credit Memo Number', T0.DocDate AS 'Credit Memo Date'
FROM
[dbo].[ORIN] T0 INNER JOIN
[dbo].[RIN1] T1 ON T0.DocEntry = T1.DocEntry LEFT JOIN
[dbo].[INV1] T2 ON T1.BaseEntry = T2.DocEntry AND T1.BaseLine = T2.LineNum AND T1.BaseType = 13 INNER JOIN
[dbo].[OINV] T3 ON T2.DocEntry = T3.DocEntry
Regards,
Vítor Vieira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.