Board index » delphi » SQL - from DATE to DATE
Sergio Gonzalez
![]() Delphi Developer |
SQL - from DATE to DATE2005-05-27 12:52:29 AM delphi170 Hi! I have a SQL like: select * from mytable where mydate between (:from_date and :to_date) I want to select *ALL* records less or equal than today. Can I do ? Params[0].AsDate := 0 Params[1].AsDate := date So far it seems to work fine. But I would like to be sure if this is a good way to do it. And what if I want to select *ALL* records ? Params[0].AsDate := 0 Params[1].AsDate := ???? I'd like to avoid the use of OR clauses like: select * from mytable where mydate between (:from_date and :to_date) or :all = -1 Thanks! Sergio |