DATA Step, Macro, Functions and more

Exclude the future month dates from the current month report

Accepted Solution Solved
Reply
Contributor
Posts: 30
Accepted Solution

Exclude the future month dates from the current month report

Hi ,

 

I have a report that will run on first of the every month.I want to exclude the future month effective date from the report. April month report should not include members with effective date  April, May, etc.

 

 

Membno Effdat    Expdat

1        20140301  20141231
2        20170401  20170430
3        20170105  20170130
4        20170301  20170330
5        20170501  20170528

 

I have the format as YYMMDDN8. for the Effdat and EXPDAT field.

 

Output should be as below:

 

Membno Effdat    Expdat

1        20140301  20141231
3        20170105  20170130
4        20170301  20170330

 

Thanks for your help.


Accepted Solutions
Solution
‎04-05-2017 07:23 PM
Super User
Posts: 10,497

Re: Exclude the future month dates from the current month report

Or a different where statement:

 

where effdat le intnx('month',today(),-1,'e');

or

where effdat lt intnx('month',today(),0,'b');

 

which would exclude recods with an effdate greater than or equal to the beginning of the current month

View solution in original post


All Replies
Super User
Posts: 17,819

Re: Exclude the future month dates from the current month report

Add a filter to your query.

 

WHERE date < {date of interest};

Solution
‎04-05-2017 07:23 PM
Super User
Posts: 10,497

Re: Exclude the future month dates from the current month report

Or a different where statement:

 

where effdat le intnx('month',today(),-1,'e');

or

where effdat lt intnx('month',today(),0,'b');

 

which would exclude recods with an effdate greater than or equal to the beginning of the current month

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 109 views
  • 0 likes
  • 3 in conversation