我现在遇到一个统计问题:
   有两个DateTimePicker,四个RadioButton。RadioButton分别是年、季、月、周。当我点击RadioButton时,DateTimePicker要相应的变化。年为去年(2004-2004),季为上个季度(2004-10-2004-12),月为上个月(2004-12-1-2004-12-31),周为上周(2005-1-17-2005-1-23)。具体该如何控制DateTimePicker的显示?关于周的算法我也挺苦恼!
   我现在只有10分了,请大家谅解!谢谢!

解决方案 »

  1.   

    procedure TForm1.RadioButton1Click(Sender: TObject);
    begin
        DateTimePicker1.Kind:=dtkDate;
        DateTimePicker2.Kind:=dtkDate;
        DateTimePicker1.Format:='yyyy';
        DateTimePicker2.Format:='yyyy';
    end;
    ------------------------------------------------------
    其它的照上边的改就行了,就是一个kind 一个 format 比较重要
      

  2.   

    同意
    另外你也可以试试这样,例如:
    AAA := FormatDateTime('YYYY-MM-DD', DateTimePicker.Date);