Blogs Home
Wednesday, February 9, 2011 2:16 PM

Meditech-L: Need Help with NPR Report Calculate date to select by

Written by Joe Cocuzzo, Senior VP of Report Writing Services - iatricSystems

%Z.day.from.date(@.today) = DOW 1-7

%Z.date.add(DATE,0-N) will subtract N days from any date and give you the date.

Combine these in a start macro to put your date range into /FROM and /THRU and then use those in your selections.

If "a whole week from two weeks ago" means back up to the current week's Sunday and then go back two weeks from that to get to the start date:

%Z.day.from.date(@.today)^DOW,
%Z.date.add(@.today,0-(DOW-1))^SUN,
%Z.date.add(SUN,0-14)^/START,
%Z.date.add(/START,7)^/END

Posted to the Meditech-L by Joe Cocuzzo, Vice President of NPR Services at Iatric Systems, Inc.