取月份的方法多的很,可以用MonthOf(日期)要引用DateUtils 单元ceil函数要引用Math 单元才可以使用

解决方案 »

  1.   

    用Month不就完了嗎(SQL SERVER)?
    或用FORMATDATETIME('MM',DATE());
    最好加上年份:
    SQL中也用YEAR這個函數;
    FORMATDATETIME('YYYYMM',DATE());
      

  2.   

    你这两个函数是在这两个单元里的:你要记得加上:
    uses StrUtils,Math;这两个函数的用法如下:
    Ceil:
      For example:
    Ceil(-2.8) = -2
    Ceil(2.8) = 3
    Ceil(-1.0) = -1midstr:For Example:var
      str,substr:string;
    begin
      str:='This is a example';
      substr:=midstr(str,4,2);
      showmessage(substr);//从结果中你就知道怎么用了!
    end;
      

  3.   

    你这两个函数是在这两个单元里的:你要记得加上:
    uses StrUtils,Math;这两个函数的用法如下:
    Ceil:
      For example:
    Ceil(-2.8) = -2
    Ceil(2.8) = 3
    Ceil(-1.0) = -1midstr:For Example:var
      str,substr:string;
    begin
      str:='This is a example';
      substr:=midstr(str,4,2);
      showmessage(substr);//从结果中你就知道怎么用了!
    end;