开发者

Substract 1 month to update table SQL Server

I need to update all the issuedat (date field) to be less than one month from the column paidat (date field)

ex:

if paidat = 01/02/2011 then issuedat should开发者_运维知识库 = 01/01/2011

UPDATE invoices SET invoices.issuedat = ????


UPDATE invoices SET invoices.issuedat = dateadd(MM,-1,paidat)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜