Avatar of hidrau
hidrau
Flag for Brazil

asked on 

I need to make a query but I don't figure out where is the problem with datetime

I made a query where I want all the records that their datetime is less than now()

But no records my query is retrieving me, why?

With Query do
Begin
     Close;
      Sql.Clear;
      Sql.Add('SELECT * FROM CTRSERVFAX');
      Sql.Add('WHERE SVFX_DATETIME<=:DT AND SVFX_STATUSFAX<>"E"');
      Sql.Add('ORDER BY SVFX_DATAHORA DESC');
      Parameters.ParamByName('DT').Value := Now();
      Open;
end


I use access as my database.

Thanks
Delphi

Avatar of undefined
Last Comment
esoftbg

8/22/2022 - Mon