我有一个问题要问你。是否有机会创建一个类似的宏,但在prco sql中的quera,它总是选择一个月的第一天和最后一天。
%let thismonth=%sysfunc(putn(%sysfunc(today()),yymmn6.));
where t1.DATE = &thismonth
and _dly. between t2.data_from and t2.data_to
and &gv_date_dly. between t3.data_from and t3.data_to
and t3.obj_code not in ('G07','N06','N07')
,其中date from要从每月的第一天开始召回,date_to要从每月的最后一天开始召回,当函数&这个月叫做
定义当前月的第一天/最后一天:
%let first = %sysfunc(intnx(month,%sysfunc(today()),0,b));
%let last = %sysfunc(intnx(month,%sysfunc(today()),0,e));