Skip to Content
Former Member
Feb 09, 2012 at 06:51 AM

Query for approval procedure - A/R invoice and A/R credit memo


Dear all,

Need one help regarding approval procedure.

Query :- If we do A/R credit memo and days from A/R invoice to A/R credit memo are geter than 180 then A/R credit memo

shoild go to the approval. (A/R invoice shoul be a base documnet)

I have made below query, but if days are >180 or <180 it is goinf for a approval. Can any one suggest for this.

SELECT distinct 'TRUE'

FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry

inner join RIN1 T2 on t2.BaseEntry=T0.DocEntry

inner join ORIN T3 on T2.DocEntry = T3.DocEntry

where DATEDIFF(day,T0.[DocDate],T3.DocDate) > 180

<a href="">megaupload</a>, <a href="">btjunkie</a>, <a href="">games</a>