调用DecodeDate函数
var
  year,month,day:word;
DecodeDate(strtodate('2002-10-09'),year,month,day);
Edit1.text:=inttostr(year);

解决方案 »

  1.   

    嘻嘻
    Yearof(DataTimeValue);
    Monthof(DataTimeValue)
    dayof(DataTimeValue)
      

  2.   

    你的是什么数据库?
    参考Access的DatePart()函数//SQL Server中也有
    DatePart("yyyy", #2002-06-05#) = 2002
    DatePart("mm", #2002-06-05#) = 6
    DatePart("dd", #2002-06-05#) = 5
      

  3.   

    嘻嘻,
    Yearof(DataTimeValue);
    Monthof(DataTImeValue);
    DayOf(DataTimeValue);
      

  4.   

    label1.captin := formardatetime('yyyy',date)
      

  5.   

    楼上都说了,再给你一种方法
    var
      year,month,day: string;
    begin
      year  := FormatDateTime('yyyy',strtodate('2002-10-09'));
      month := FormatDateTime('mm',strtodate('2002-10-09'));
      day   := FormatDateTime('dd',strtodate('2002-10-09'));
    end;