to get date dynamically exceeding 24hrs
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.
精彩评论