在Access中如何让DATEADD("d",30,日期) 的“日期”随着计算机时间更新

来源:百度知道 编辑:UC知道 时间:2024/06/06 23:40:14
高手帮忙,随着计算机的时间直接加3个月上去
两位老大,我早试了没有用啊

DATEADD("m",3,Date())

你也可以用Now()

使用dateadd("mm" , 3, date)
这样可以在你想要的日期上加减你的时间.+正为加,-负为减,
yyyy 年
mm 月
d 日
.....

  1. select * from pays where 1=1 and datepart(year, pdate)=2013 and datepart(month, pdate)=2 and datepart(day, pdate)=26 order by pdate

  2.  select * from pays where 1=1 and datepart("yyyy", pdate)=2013 and datepart("m", pdate)=2 and datepart('d', pdate)=21 order by pdate


在Access中直接使用date()函数就行了。