I suspect you want to check that it’s after 11pm or before 7am:
select *
from MyTable
where CAST(Created as time) >= '23:00:00'
or CAST(Created as time) < '07:00:00'
More Related Contents:
- How to create a specific SQL Server stored procedure? [closed]
- SQL Server dynamic PIVOT query?
- SQL Server – Best way to get identity of inserted row?
- Should I use != or for not equal in T-SQL?
- How to update two tables in one statement in SQL Server 2005?
- SQL Server Process Queue Race Condition
- Is the NOLOCK (Sql Server hint) bad practice?
- SQL – Subtracting a depleting value from rows
- OR is not supported with CASE Statement in SQL Server
- How to set variable from a SQL query?
- Compare DATETIME and DATE ignoring time portion
- Easiest way to populate a temp table with dates between and including 2 date parameters
- T-SQL: Selecting Column Based on MAX(Other Column)
- unresolved reference to object [INFORMATION_SCHEMA].[TABLES]
- SQL dot notation
- Split function in SQL Server 2008
- T-SQL How to create tables dynamically in stored procedures?
- What is the difference between SQL, PL-SQL and T-SQL?
- What is the equivalent of ‘describe table’ in SQL Server?
- Create a SQL query to retrieve most recent records
- How can I group by date time column without taking time into consideration
- Update query using Subquery in Sql Server
- T-SQL: checking for email format
- Database Naming Conventions by Microsoft?
- Convert date to YYYYMM format
- Conversion failed when converting the varchar value ‘simple, ‘ to data type int
- Is there a quick way to check if ANY column is NULL?
- SQL Convert Week Number to Date (dd/MM)
- SQL query for parent-child chain
- T-SQL Conditional Order By