你可以在字段的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;
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;
FormatDateTime('dd',StrToDatetime('2003-3-12'));
再通过语句显示在报表中
value值是12
如:dya(), DatePart()
通过DELPHI可以取日期的一部分值:
FormatDateTime('dd',StrToDatetime('2003-3-12'));