在sql数据库中如何筛选以日期为条件的记录?

如果要在SQL数据库中根据日期过滤记录,可以使用两种方法实现,如下:第一种:直接使用语句date1和date2,它们是字符串SQL.Tet:='select*fromtablewherefieldBetween'+Quotedstr(date1)+'and'+Quotedstr(date2date1和date2是日期SQL.Tet:='select*fromtablewhere字段之间'+Quotedst);r(DateTimeToStr(date1))+'and'+Quotedstr(DateTimeToStr(date2));d1').Value:=date1;Parameters.ParamByName('d2').Value:=date2;

我要从数据库中时间字段里面筛选超过3个月时间数据

select*wheredateadd(月份,3,录入时间)from表名