select * from Client_Table where InputDate=dateadd(dd,-1,getdate()) È¡²»µ½ÈκÎÊý¾Ý select * from Client_Table where datediff(dd,InputDate,getdate()) <=1 ͬÑùÈ¡²»µ½ÈκÎÊý¾ÝSQL code: select * from Client_Table where cast(InputDate as datetime)=getdate()-1
²»³ö´í£¬Ò²µÃ²»µ½ÈκÎÊý¾Ý
Èç¹ûÕâÌõÈ¡²»µ½Êý¾Ý,¾ÍÊÇÄã±¾Éí²»´æÔÚ×òÌìµÄÊý¾Ý.
SQL code: select * from Client_Table where datediff(dd,InputDate,getdate()) <=1
Äã¿ÉÒÔ³¢ÊÔ¿´¿´:
SQL code: select * from Client_Table where convert(varchar(10),InputDate,120) = '2009-11-21'
SQL code:
select * from Client_Table where datediff(dd,cast(InputDate as datetime),getdate()) <=1