Skip to Content
0

User Query - DocEntry

Feb 07, 2017 at 04:24 PM

31

avatar image

Hello,

I made such query:

SELECT T1.[DocEntry] , T0.[DocNum], T0.[DocDate], T0.[CardName], T0.[DocStatus]   FROM ORDR T0 <br>INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
WHERE T0.[DocDate]  <= GETDATE()  -5 and T0.DocStatus='O'

works good, but one thing I would like to improove

Now the query returns for each article/item in RDR1 own row, so when some Order has 3 articles in result I see 3 rows for this order. Is somehow possible to I could get for one Order one just row/record.

I know that what I need do such query:

SELECT  T0.[DocNum], T0.[DocDate], T0.[CardName], T0.[DocStatus]   FROM ORDR T0  
 WHERE T0.[DocDate]  <= GETDATE()  -5 and T0.DocStatus='O'

but here is a problem, that in result are not yellow arrows, so I cannot enter to the document. It was the reason why I have used the query above with the DocEntry what help me to display 'yellow arrow'.

Thank You

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Zdenek Chladek Feb 07, 2017 at 05:19 PM
0

SOLVED:

SELECT T0.[DocEntry] , T0.[DocNum], T0.[DocDate], T0.[CardName], T0.[DocStatus]

FROM ORDR T0

WHERE T0.[DocDate] <= GETDATE() -5 and T0.DocStatus='O'

Share
10 |10000 characters needed characters left characters exceeded