如何根据超过24小时的时间选择记录 [英] How to select the records based on time greater than 24 hrs

查看:89
本文介绍了如何根据超过24小时的时间选择记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个customeinfo表,我想在其中选择时间戳大于24小时的所有记录< br $>


我的计算将是



Hi ,

I have a customeinfo table in which i want to select all the records whose time stamp is greater than 24hrs

My calculation will be

CustomerInfoTimeStamp = (CurrentTime-LastUpdated) 

if(CustomerInfoTimeStamp>24hrs)
{

select * from customerInfo where time=CustomerInfoTimeStamp
}





关注



Regards

推荐答案

为什么不...



select * from customerInfo where datediff(hh,GETDATE(),LastUpdated)> 24



Best使用SQL而不是程序代码。
Why not...

select * from customerInfo where datediff(hh,GETDATE(),LastUpdated)>24

Best to use SQL rather than program code.


这篇关于如何根据超过24小时的时间选择记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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