如何在SQL中将Int转换为DateTime

如何在SQL中将Int转换为DateTime

问题描述:

仅在storedprocedures中



我有一个int数据类型,它将被转换为datetime然后我会在datetime数据类型中添加它,任何人都知道如何做到这一点? br />


这是逻辑



CAST(NUMBEROFDAYS AS DATE)

EXPIRYDAY = NUM​​BEROFDAYS + DATETODAY



-我没有谷歌:)

In storedprocedures only

I got an int datatype which will be converted into datetime then i will add it at a datetime datatype anyone know how to do it?

This is the Logic

CAST(NUMBEROFDAYS AS DATE)
EXPIRYDAY = NUMBEROFDAYS + DATETODAY

-I dont have google :)

我们无法回答:这取决于你在整数中的值:它是一个时间点以来的天数,以及SQL时间刻度或什么点。



所以,如果必须,请选择Google或Bing,然后开始寻找。

我们不是来为您做研究。
We can't answer that: it depends on what value you have in your integer: is it a number of days since a point in time, and what point, SQL time ticks, or what.

So get Google, or Bing if you must, and start looking.
We are not here to do your research for you.