您的位置:程序门 -> .net技术 -> vb.net



如果让sql语句判断以今天日期为准前3天的日期


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


如果让sql语句判断以今天日期为准前3天的日期[已结贴,结贴人:gaofeng_0420]
发表于:2007-07-01 10:25:51 楼主
如果让sql语句判断以今天日期为准前3天的日期,高手指教下,谢谢
发表于:2007-07-01 10:37:401楼 得分:30
sql   =   "select   *   from   table   where   datediff(day,字段,getdate())   =3   "

也可以用vb代码
datetime.adddays(-3)得到3天前
发表于:2007-07-01 10:40:322楼 得分:70
select   *   from   yourtable  
where   字段   <   getdate()   and   字段   >   dateadd(dd,   -3,   getdate())
发表于:2007-07-01 10:40:423楼 得分:0
http://technet.microsoft.com/zh-cn/library/ms189794.aspx
http://paker.cnblogs.com/archive/2006/02/14/330255.html
http://www.xishui.net/info/2006-2/2006-2-28-2902.htm


http://msdn2.microsoft.com/zh-cn/library/system.datetime.adddays(vs.80).aspx


快速检索

最新资讯
热门点击