如何检查两个不同的查询运行时间(上午1:30到3:30) [英] How to check two different times which are the query run.(Between 1:30AM to 3:30 AM)

查看:73
本文介绍了如何检查两个不同的查询运行时间(上午1:30到3:30)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在sql server中的单个查询中检查两个角钱。

I want to know how to check two dimes in single query in sql server.

推荐答案

select * from table 其中CONVERT(时间, datetimefieldname

CONVERT(时间,CONVERT(varchar(10),getdate(),111)+'1:30 AM')和

CONVERT(时间,CONVERT(varchar(10),getdate(),111)+'3:30 AM')
select * from table where CONVERT(time,datetimefieldname) between
CONVERT(time,CONVERT(varchar(10),getdate(),111) + ' 1:30 AM') and
CONVERT(time,CONVERT(varchar(10),getdate(),111) + ' 3:30 AM')


这篇关于如何检查两个不同的查询运行时间(上午1:30到3:30)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆