I am trying to select a date range with this query. When it is run without the WHERE clause, it works fine. When I add the WHERE clause, I get the error 'Received Alerts' (OAIB). Here is the code:
SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.U_RMA_NUM, T1.ItemCode, T1.Dscription, T1.Quantity, T1.LineTotal, T2.Name[Return Reason Desc], T3.Name[Disposition Description],T0.Comments FROM ORDN T0 INNER JOIN RDN1 T1 ON T0.DocEntry = T1.DocEntry Left Outer JOIN [dbo].[@PRE_CUSTREA] T2 ON T0.U_RMA_CREAS = T2.Code Left Outer JOIN [dbo].[@PRE_RMADISP] T3 ON T0.U_RMA_DISP = T3.Code
WHERE T0.DocDate between [%0] and ['%1]
Does anyone have any ideas why this is erring out? Thanks for your help.