如何在SQL中将Int转换为DateTime [英] How to convert Int to DateTime in SQL

查看:532
本文介绍了如何在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.


这篇关于如何在SQL中将Int转换为DateTime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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