Topic: read database table

Very thanks for  1.41

I have this question
It's possible in script session to read a database table?
I have a Date Time Picker with a input date (dtp_initDate) ad i want to compare it with a date in other table called holidays and field giorno but without component in form .

Thanks for read this

Re: read database table

You can use function SQLExecute for read database table

Example, how to compare date from DateTimePicker and database field

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
   sDate: string;
   sResult: string;
begin
     sDate := FormatDateTime('yyyy-MM-DD 00:00:00.000', Form1.DateTimePicker1.DateTime); // get date like string with format yyyy-MM-DD 00:00:00.000
     sResult := VarToStr(SQLExecute('SELECT count(id) FROM person WHERE datefield="'+sDate+'"')); // SQL query for calculate count of records with same date in DateTimePicker1
     ShowMessage(sResult); // show count
end;
Dmitry.

Re: read database table

Very thanks for time