delphi 查询数据库表里两星期内的记录
现有数据库表table,表里设有字段PDATE,表示日期。 现要查询距离现在时间两星期之内的所有记录,该怎样写出相应的SQL语句呢? 我用的是delphi 5 . 貌似是与delphi的版本有关吧。 delphi??数据库???时间段 deiphi 数据库 查询时间段内记录
[解决办法]
SQL语句与delphi版本无关。
select * from table where pdate between (getdate()-14) and getdate()
[解决办法]
select * from table where (Trunc(sysdate)-Trunc(pdate))<15