I am trying to write a PROC SQL statement which is extracting data from SQL Server based on some date criteria. %let ExamStartDate = 01APR2017; %let ExamEndDate = 01MAY2017; data _null_; call symputx('sdate',put("&ExamStartDate."d,yymmdd10.)); call symputx('edate',put("&ExamEndDate."d,yymmdd10.)); run; proc sql; connect to odbc (dsn='aa' user=user pw=pw); create table temp1 as select * from connection to odbc ( SELECT cnd.firstName, cnd.middleName, cnd.lastName, cd.calendarDate as date FROM candidate cnd inner join CalendarDate cd with (NOLOCK) on cd.calendarDateId=cnd.eventDateId and cd.calendarDate >= convert(datetime,&sdate.) ); quit; When I run the code, it gives me all records and does not filter out the data. Can anyone suggest what am I doing wrong here. Thanks for the help.
... View more