OiO.lk Blog SQL SQL “incompatible data type in criteria expression” error
SQL

SQL “incompatible data type in criteria expression” error


I am doing a simple SELECT query by clicking on the month in a ComboBox. It lists the people who work in this month.

I have the month table (Num_Month "PK") and the person_month table (Num_Month "FK") both of integer type, and I checked well at execution, but I always get the error:

incompatible data type in criteria expression

I tried with TDBLookupComboBox to import months from the month table but the same error appears.

With Q1 do
Begin
  Close;
  Sql.Clear;
  Sql.Add('Select * from Person_Month Where Num_month ='+QuotedStr(ComboBox1.Text));
  Open;
  DBGrid2.DataSource.DataSet.Open;
End;



You need to sign in to view this answers

Exit mobile version