Dear Experts,
In following query I needed Purchase Order's *DocDate* if it links to an AP Inv. but in following query P.O's Docdate is not coming right.
It is fetching just a random date.
SELECT T0.[DocNum], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[U_Del_Delay], T1.[ShipDate], T1.[ActDelDate], T0.[U_challan_date] as 'Challan Date', t2.docdate FROM [dbo].[OPCH] T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry inner join opor t2 on t0.docentry = t2.docentry WHERE T1.[U_Del_Delay] < '0' and T0.[DocDate] between [%0] and [%1]
Kindly correct this query.
It will be highly appreciated.
Regards,
Ravi