我如何获得比今天更少的日期日期。 [英] How Do I Get The Date Less Than Today Date .
本文介绍了我如何获得比今天更少的日期日期。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Team,
我如何得到的日期少于今天的日期。
我想要更新查询。
我有:
update job
set
CLEARANCESTATUS = ' Y',
CLEARANCEDATE = getdate(),
LANDEDDATE = getdate(),
LANDEDSTATUS = ' Y'
其中 id = 5517
在getdate()函数中,它给了我今天的日期,但我想比今天的日期更新。它可能....请指导..
谢谢
Harshal
解决方案
update job
set
CLEARANCESTATUS = ' Y',
CLEARANCEDATE = DATEADD(d,-7,getdate()),
LANDEDDATE = getdate(),
LANDEDSTATUS = ' Y'
其中 id = 5517这会将清关日期设置为上周。
update工作
设定
CLEARANCESTATUS ='Y',
CLEARANCEDATE = DATEADD(d,-7,getdate()),
LANDEDDATE = getdate(),
LANDEDSTATUS ='Y'
其中DATEADD(d,-1,GetDate())
你可以用这种方式添加和删除日期...
DATEADD(d, 要添加或减去的天数(int),Getdate())
Hello Team,
How do i get the date less than today date.
I want in update query.
I have :
update job
set
CLEARANCESTATUS = 'Y',
CLEARANCEDATE = getdate() ,
LANDEDDATE = getdate(),
LANDEDSTATUS = 'Y'
where id = 5517
In getdate() function it gives me today date but i want to update less than today date .is it possible....please kindly guide ..
Thanks
Harshal
解决方案
update job set CLEARANCESTATUS = 'Y', CLEARANCEDATE = DATEADD(d, -7, getdate()) , LANDEDDATE = getdate(), LANDEDSTATUS = 'Y' where id = 5517That will set the clearance date to last week.
update job
set
CLEARANCESTATUS = 'Y',
CLEARANCEDATE = DATEADD(d, -7, getdate()) ,
LANDEDDATE = getdate(),
LANDEDSTATUS = 'Y'
where DATEADD (d, -1 , GetDate())
You can Add and Remove in date in this way...
DATEADD(d,"Days you want to add or subtract(int)",Getdate())
这篇关于我如何获得比今天更少的日期日期。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文