Respuesta2
Hola!
Si le pongo QuotedStr me da error: sintaxis error convirtiendo un datetime a un caracter string. Gracias.
if Menor.Checked = True then
DataModule2.QTTabla.SQL.Add('SELECT * FROM TTabla WHERE Fecha < ' + QuotedStr(Filtrar.Text) + ' ORDER BY Fecha');
if Mayor.Checked = True then
DataModule2.QTTabla.SQL.Add('SELECT * FROM TTabla WHERE Fecha > ' + QuotedStr(Filtrar.Text) + ' ORDER BY Fecha');
if Igual.Checked = True then
DataModule2.QTTabla.SQL.Add('SELECT * FROM TTabla WHERE Fecha = ' + QuotedStr(Filtrar.Text) + ' ORDER BY Fecha');
En el caso de un campo alfanumerico yo lo tengo asi y no da error pero con la fecha me da error.
WhereClause := 'NombreyApellidos LIKE ' + QuotedStr(Filtrar.Text + '%');
DataModule2.QTICuna.SQL.Add('SELECT * FROM TICuna WHERE ' + WhereClause + ' ORDER BY Fecha');
|