如何在报表中只显示日期型字段的日如2003-3-12 我只想显示12

解决方案 »

  1.   

    AsDate不可以吗?不行就COPY出来!
      

  2.   

    你可以在字段的OnGetText事件中控制要显示的格式
    procedure TForm1.ADOQuery1ddGetText(Sender: TField; var Text: String;
      DisplayText: Boolean);
    begin
      //Sender is the field whose value the event handler supplies.
      //Text returns a string that represents the field's value.
      //DisplayText is true if the field's value is to be used for display only,
      //false if the string is to be used for editing the field's value.
    end;
      

  3.   

    先获得日
    FormatDateTime('dd',StrToDatetime('2003-3-12'));
    再通过语句显示在报表中
      

  4.   

    var value:string;value:=FormatDateTime('dd',StrToDatetime('2003-3-12'));
    value值是12
      

  5.   

    假如你的是MSSQL的话,通过SQL 可以取日期的部分
    如:dya(), DatePart()
    通过DELPHI可以取日期的一部分值:
    FormatDateTime('dd',StrToDatetime('2003-3-12'));
      

  6.   

    formatdatetime('nn','2003-3-12')