Hi, could you try this, please (I added a 'd' at the end of your "dt" variable (see in red) data temp; curr_date = "10Mar2013"d; first_day_prev_month = intnx('month',curr_date,-1,'B'); last_day_prev_month = intnx('month1',curr_date,-1,'E'); call symput('dt', "'"||put(first_day_prev_month, mmddyyd10.)||"'d"); call symput('dt1', "'"||put(last_day_prev_month, mmddyyd10.)||"'d"); format curr_date first_day_prev_month last_day_prev_month mmddyyd10.; run; proc sql; connect to Access as db (path="T:\CCMS Production\CCMSProduction.accdb"); create table Dep as select * from connection to db (select * from [tbl_depositcompliance] where tbl_depositcompliance.Scheduled_Settle between &dt. and &dt1. ); quit; Let me know if this works. Good luck Anca.
... View more