Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reporting for last week using macros

Status
Not open for further replies.
Jun 23, 2009
2
GB
I'm trying to run a report each week that includes data for Monday to Sunday (for the previous week).
I've plagorised some code to get the dates for last week, but, I'm stuggling to get this to work when using the macros in my code.
This is what I've used for obtaining dates...

data _null_;
i = put(today(),weekday.);
prevsundate = put(today()-i+1,yymmdd10.);
prevmondate = put(today()-(i+5),yymmdd10.);
call symput("Mon","'"!!prevmondate!!"'");
call symput("Sun","'"!!prevsundate!!"'");
run;
%put &Mon. and &Sun.;

I need to report between &Mon and &Sun when I try

where open_date >= &mon. and open_date <= &sun.

I get this error in the log:
Expression using greater than or equal (>=) has components that are of different data types.

Please let me know if you can help :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top