Here is my code with errors message.. The 1st table works as the data step. The issue is when to select today date minus 1 or 3 options symbolgen; %LET START = TODAY(SYSDATE,'DD-MON-RR') -3; proc sql; CREATE TABLE Part1 AS select * from connection to ODBC (SELECT Date, CodeNumber, Sum(Amount) AS ReplenAmount FROM tbVendors where DATE > {ts'2012-11-04 00:00:00'} GROUP BY Date, cOdeNumber,Amount ORDER BY CodeNumber); Run; data Part1; set Part1; date=datepart(ReplenDate); format date MMDDYY8.; run; proc sql; CREATE TABLE First AS (SELECT Date, CodeNumber, Sum(Amount) AS ReplenAmount FROM Part1 Where Date >= &START ); Run; ERROR: Function TO_DATE could not be located. ERROR: Expression using subtraction :smileyminus: requires numeric types. ERROR: The following columns were not found in the contributing tables: SYSDATE
... View more