12345678910111213141516171819202122232425262728293031323334353637 |
- $PBExportHeader$f_rst_mon_1st.srf
- $PBExportComments$返回日期
- global type f_rst_mon_1st from function_object
- end type
- forward prototypes
- global function datetime f_rst_mon_1st (integer arg_type, long arg_yearmon)
- end prototypes
- global function datetime f_rst_mon_1st (integer arg_type, long arg_yearmon);//返回月第一天
- //f_rst_mon_1st(arg_type,arg_yearmon)
- //arg_type
- //1:当月第一天
- //2:下月第一天
- //3:当月最后一天
- datetime rst_next_1st
- datetime sdate,edate
- select sdate,edate into :sdate,:edate
- from cw_calendar
- where accsetid = :sys_accsetid
- and cmonth = :arg_yearmon;
- choose case arg_type
- case 1
- rst_next_1st = sdate
- case 2
- rst_next_1st = datetime(RelativeDate ( date(string(edate,'yyyy-mm-dd')), 1 ),time(0))
- case 3
- rst_next_1st = datetime(date(string(edate,'yyyy-mm-dd')),time('23:59:59'))
- end choose
- return rst_next_1st
- end function
|