//--------------------------------------------------------------------------- void __fastcall TFormCosts::FormShow(TObject *Sender) { DateTimePicker1->Date = Now(); Edit1->Text = ""; Edit2->Text = "0"; Edit3->Text = FormatDateTime("dd.mm.yyyy", IncMonth(Now(), -1)) +"-"+ FormatDateTime("dd.mm.yyyy", Now()); Label4->Caption = IniFile->ReadString("Resource", "ofMonth", "0"); //FormRes->Label3->Caption; if(ADOQuery1->Active) { ADOQuery1->Active = false; } ADOQuery1->SQL->Text = "SELECT * FROM Costs"; ADOQuery1->Active = true; ShowScrollBar(DBGrid1->Handle, SB_BOTH, false); }
TDateTime IncYear(const TDateTime & AValue, const Int64 ANumberOfYears) { TDateTime Result; Result = IncMonth(AValue, ANumberOfYears * MonthsPerYear); return Result; }