f_last_ctdate.srf 588 B

1234567891011121314151617181920212223242526
  1. $PBExportHeader$f_last_ctdate.srf
  2. global type f_last_ctdate from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_last_ctdate (ref datetime arg_ctdate, ref string arg_msg)
  6. end prototypes
  7. global function integer f_last_ctdate (ref datetime arg_ctdate, ref string arg_msg);//取最后截数时间
  8. int rslt = 1
  9. select max(ct_datetime)
  10. into :arg_ctdate
  11. from sys_ct_data;
  12. if sqlca.sqlcode = -1 then
  13. rslt = 0
  14. arg_msg = '查询最后截数日期出错'
  15. goto ext
  16. elseif sqlca.sqlcode = 100 or isnull(arg_ctdate) then
  17. rslt=2
  18. end if
  19. ext:
  20. return rslt
  21. end function