如何定义一个月的第一天和最后一天

How do defining the first and last day of the month

我有一个问题要问你。有没有机会创建一个类似于此的宏,但在 prco sql in 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_to 到调用函数 & 这个月的最后一天

定义当月的第一天/最后一天:

%let first = %sysfunc(intnx(month,%sysfunc(today()),0,b));
%let last  = %sysfunc(intnx(month,%sysfunc(today()),0,e));