I’m trying to set a macro date variable and use that variable within a sql statement but I can’t seem to get the syntax right.
Example:
%let end_date = %sysfunc(today(),mmddyy10.);
%let beg_date = &end_date – 60;
Select column1
From table1
Where datecolumn between &beg_date and &end_date
The end_date variable is set to the current system date and that works fine but I can’t seem to set the second variable to be 60 days prior to the current date. I’ve tried many different variations and I can’t figure it out.
I can do this within a data step but It doesn’t work with a macro variable.
... View more