我在运行程序时出现以下提示错误:
   " project **.exe raised exception class Econverterror with message ' ":28:2" is not valid date and time ' process stoped.
大家帮忙看看啊,谢谢!

解决方案 »

  1.   

    ":28:2" is not valid date and time
      

  2.   

    unit showRishouRumingxi;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, Grids, DBGrids, DB, ADODB, ExtCtrls, StdCtrls, ComCtrls;type
      TshowRishouRumingxi_w = class(TForm)
        ADOQuery1: TADOQuery;
        DataSource1: TDataSource;
        PageControl1: TPageControl;
        TabSheet1: TTabSheet;
        GroupBox2: TGroupBox;
        RadioButton3: TRadioButton;
        RadioButton4: TRadioButton;
        Button1: TButton;
        RadioButton1: TRadioButton;
        GroupBox1: TGroupBox;
        DBGrid1: TDBGrid;
        Label1: TLabel;
        procedure FormShow(Sender: TObject);
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      showRishouRumingxi_w: TshowRishouRumingxi_w;implementationuses login, dateattribute, share;{$R *.dfm}procedure TshowRishouRumingxi_w.FormShow(Sender: TObject);
    var
     qs,zz:string;
    begin
    qs:=copy(datetimetostr(dateattribute_w.DateTimePicker2.Date),1,10);
    zz:=copy(datetimetostr(dateattribute_w.DateTimePicker3.Date),1,10);Adoquery1.Close;
    Adoquery1.SQL.clear;
    Adoquery1.sql.Add('select bianhao as 档案编号,zibianhao as 自编号,xingming as 姓名,yingshou as 收入,shoufeidate as 收费日期 from huohuaku where shoufeidate>='''+qs+''' and shoufeidate<='''+zz+''' order by shoufeidate');
    Adoquery1.Open;
    Dbgrid1.Columns[0].Width:=54;
    Dbgrid1.Columns[1].Width:=40;
    Dbgrid1.Columns[2].Width:=52;
    Dbgrid1.Columns[3].Width:=57;
    Dbgrid1.Columns[4].Width:=64;
    if not Adoquery1.Eof then
      begin
        share_w.sql('select sum(yingshou) from huohuaku where shoufeidate>='''+qs+''' and shoufeidate<='''+zz+'''');
        label1.Caption :='记录:'+inttostr(Adoquery1.Recordcount)+'   合计:'+inttostr(share_w.Adoquery1.fields[0].value);
      end else
        label1.Caption :='记录:0   合计:0';end;procedure TshowRishouRumingxi_w.Button1Click(Sender: TObject);
    var
     qs,zz:string;
    begin
    qs:=copy(datetimetostr(dateattribute_w.DateTimePicker2.Date),1,10);
    zz:=copy(datetimetostr(dateattribute_w.DateTimePicker3.Date),1,10);
    share_w.SQL('delete binzangshourumingxibiao');
    share_w.SQL('insert into binzangshourumingxibiao select * from huohuaku where shoufeidate>='''+qs+''' and shoufeidate<='''+zz+'''');
    share_w.SQL('insert into binzangshourumingxibiao(xingming,shoufeidate,jicun,yinshou) select xingming,shoufeidate,jine,jine from guhuijfjlku where shoufeidate>='''+qs+''' and shoufeidate<='''+zz+'''');
    {yewushoufeibiao1_w.Adoquery1.Close;
    yewushoufeibiao1_w.Adoquery1.SQL.clear;
    yewushoufeibiao1_w.Adoquery1.SQL.Add('select * from binzangshourumingxibiao order by zibianhao');
    yewushoufeibiao1_w.Adoquery1.Open;
    yewushoufeibiao1_w.QuickRep1.Preview;  }
    end;end.
      

  3.   

    uses login, dateattribute, share;
    这么多单元的引用,你还是自己设置断点问题出在哪吧,把关键代码贴出来就好了
      

  4.   

    qs:=copy(datetimetostr(dateattribute_w.DateTimePicker2.Date),1,10);
    zz:=copy(datetimetostr(dateattribute_w.DateTimePicker3.Date),1,10);
    有没有错误啊?
      

  5.   

    何必呢
    function FormatDateTime(const Format: string; DateTime: TDateTime): string; overload;
    function FormatDateTime(const Format: string; DateTime: TDateTime; const FormatSettings: TFormatSettings): string; overload;st:=FormatDateTime('yyyy-mm-dd',now);