开发者

to get date dynamically exceeding 24hrs

开发者 https://www.devze.com 2023-02-01 08:59 出处:网络
Iam writing a query by which i should get the contents from table which are not attended even after 24hrs of it is created .Can any one please tell me how to get the contents . Right now iam using

Iam writing a query by which i should get the contents from table which are not attended even after 24hrs of it is created .Can any one please tell me how to get the contents . Right now iam using

Created_time<'+DateTime.Now.addmin(-24)+'

But this is not working .Can any one please help me out

Thanks in advan开发者_如何学Goce for any answers


Use the date functionality in the database only, that will save you trouble in the long run. Use a query like:

SELECT * FROM table_of_interest WHERE datediff(curdate(), created_time) > 0

As for your original DateTime.Now.addmin(-24), I would expect that to be 24 minutes in the past, rather than 24 hours, but I don't know what language you're using so I might be wrong.

0

精彩评论

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