-2

我有一个名为“student_details”的数据库表。它包含一个列-“token_timestamp”。我想找出当前时间和这个 'token_timestamp' 之间的差异。它不应该大于 80 分钟。我应该在'where'条件下写什么?请帮忙

    SqlCommand cmd=new SqlCommand("select student_id from student_details where  ??? ,con1);
4

1 回答 1

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);
于 2013-04-26T10:22:49.037 回答