You just have to know about the SQL syntax. As already mentioned by digimanus you can use
AND
within
WHERE
clauses.
But you should use parametrised queries to avoid
SQL injection - Wikipedia[
^] when the data has been entered by users. Such allow also passing data by value instead of string which is especially useful with dates (no conversion problems) and floating point values (no rounding errors).
Untested example:
var
Param : TParameter;
ADOQuery1.SQL.Add('SELECT * FROM employé WHERE name_column = :Name AND date_column = :Date');
Param := ADOQuery1.Parameters.ParamByName('Name');
Param.DataType := ftString;
Param.Value := varName;
Param := ADOQuery1.Parameters.ParamByName('Date');
Param.DataType := ftDate;
Param.Value := varDate;
Related links:
ADOQuery (Delphi) - RAD Studio Code Examples[
^]
TADOQuery.Parameters Property[
^]
Read also about the SQL syntax of the used database engine. While the basic syntax is the same there are some differences like for quoting identifier names which must be done when such identifiers are reserved words. You have to do that also if you have a datetime in the database and want to match a date without time. Each database engine has different commands to get the date portion of a datetime for comparison.