我有一个名为'student_details'的数据库表。它包含一个coloumn -'token_timestamp'。我想找出当前时间和'token_timestamp'之间的区别。它不应该大于80分钟。我应该在'哪里'条件下写什么?请帮忙
SqlCommand cmd=new SqlCommand("select student_id from student_details where ??? ,con1);
答案 0 :(得分:0)
试试这个......
SqlCommand cmd=new SqlCommand("select student_id from student_details where
DateDiff(minute,Cast(token_timestamp as smalldatetime),CAST(cast(GetDate() as time) as smalldatetime))>80"
,con1);