1. procedure TForm1.Button1Click(Sender: TObject);var Present: TDateTime; Year, Month, Day, Hour, Min, Sec, MSec: Word; begin Present:= Now; DecodeDate(Present, Year, Month, Day); Label1.Caption := 'Today is Day ' + IntToStr(Day) + ' of Month ' + IntToStr(Month) + ' of Year ' + IntToStr(Year); DecodeTime(Present, Hour, Min, Sec, MSec); Label2.Caption := 'The time is Minute ' + IntToStr(Min) + ' of Hour ' + IntToStr(Hour); end; 2.C:\Program Files\Borland\Delphi5\Demos\Quickrpt
显示日期要Format:='yyyy-MM',默认日期不要用系统的1899-12-30。
1、vstr := formatdatetime('HH:MM',now) 小时、分2、select * from tablename where datefield between datestart and dateend datestart,dateend为日期值 打印报表建议使用fastReport
procedure TForm1.Button1Click(Sender: TObject);var
Present: TDateTime;
Year, Month, Day, Hour, Min, Sec, MSec: Word;
begin
Present:= Now;
DecodeDate(Present, Year, Month, Day);
Label1.Caption := 'Today is Day ' + IntToStr(Day) + ' of Month '
+ IntToStr(Month) + ' of Year ' + IntToStr(Year);
DecodeTime(Present, Hour, Min, Sec, MSec);
Label2.Caption := 'The time is Minute ' + IntToStr(Min) + ' of Hour '
+ IntToStr(Hour);
end;
2.C:\Program Files\Borland\Delphi5\Demos\Quickrpt
datestart,dateend为日期值
打印报表建议使用fastReport
HourOf 取得小时
//uses DateUtils用Qrreport做就好了
第二点,就是把日期加上去再进行查询了