sql statement not working lazarus / 16-Databases ---------------------------------------------------------------------- davesimplewear · 2010-02-02 03:55 Hi I am using a sqlite3 dbase to test a sql statement, one of the fields is boolean, and to test I created a test table, query the table to select only the fields reading a false boolean which is set to 0 true to 1, in the table a true reading results in a value of 65535 and false as 0. The query is as follows:  procedure TForm1.FormShow(Sender: TObject); begin   TTest.SQL:='Select * from test where married = 0'; end;    both true and false fields show, where am I going wrong? Regards Dave ---------------------------------------------------------------------- jagorath · 2010-02-02 05:58 Maybe you have to close and re-open the dataset, or refresh it. ---------------------------------------------------------------------- davesimplewear · 2010-02-02 06:24 Hi jograth, Thanks for your suggestion, tried: procedure TForm1.FormShow(Sender: TObject); begin   TTest.DisableControls;   TTest.SQL:='Select * from test where married = 0';   TTest.EnableControls;   TTest.Refresh; end;  Same Result Regards Dave ---------------------------------------------------------------------- jagorath · 2010-02-02 06:55 That may not actually close and open the table.  Try this - TTest.DisableControls; try   TTest.Close;   TTest.SQL:='Select * from test where married = 0';   TTest.Open; finally   TTest.EnableControls; end; ---------------------------------------------------------------------- davesimplewear · 2010-02-02 07:58 Well that worked, thank you for your help. Regards Dave