Check This,
SELECT T0.[DocNum] PayNum , T0.[DocDate] PayDate , T0.[CardCode], T0.[CardName], T0.[CashSum], T0.[CheckSum], T0.[TrsfrSum], T2.[DocNum] InvNum , T2.[DocDate] InvDate FROM [dbo].[ORCT] T0 INNER JOIN RCT2 T1 ON T0.DocEntry = T1.DocNum, OINV T2 WHERE T0.[Canceled] ='N' and T2.[DocEntry] = T1.[DocEntry] and T2.[DocDate] between [%0] and [%1]