如何在今天专栏中取得今天的前一天 [英] How to get the day before today in todate column

查看:83
本文介绍了如何在今天专栏中取得今天的前一天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我想在todate列中了解获取今天前一天数据的代码.

[edit]已删除呼喊声-OriginalGriff [/edit]

Hello

I want to know the code for getting the data for day before today in todate column.

[edit]SHOUTING removed - OriginalGriff[/edit]

推荐答案

使用SQL DATEADD函数:w3schools [ ^ ]

将Datepart设置为"day",并将数字设置为"-1"
Use the SQL DATEADD function: w3schools[^]

Set the Datepart to "day", and the number to "-1"


以以下方式编写查询:

选择dateadd(day,-1,getdate());

您可以从
获取更多信息 http://msdn.microsoft.com/en-us/library/ms186819.aspx [ ^ ]
Write the query in the following manner:

select dateadd(day, -1, getdate());

You can get additional information from
http://msdn.microsoft.com/en-us/library/ms186819.aspx[^]


这篇关于如何在今天专栏中取得今天的前一天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆