开发者

Calculate open hours

开发者 https://www.devze.com 2023-04-03 08:18 出处:网络
I am using a SQL query select datediff(hour, Convert(DateTime, Convert(DateTime, Convert(nVarChar, cast(complaintdate as datetime), 101)) + \'\' +

I am using a SQL query

select 
    datediff(hour, Convert(DateTime, Convert(DateTime, Convert(nVarChar, cast(complaintdate as datetime), 101)) + '' +  
            开发者_运维问答 Convert(varchar, complainttime, 114)), dateadd(mi, 330, GETUTCDATE())) 
from complaintregister

it creates results like:

No column name
  15455
  15259
  15190
  15190
  15165
   300
   200
  1000
   500

and I want the colum only containg values > 1000


I agree with Jon Skeet's comment, but to answer your question, surely you only need to add a where clause: "where [Open Hours] > 500"?

0

精彩评论

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