Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

SQL Server query to get data for a particular date and time

select * 
from table_name
WHERE  (SELECT  CONVERT(char(5),SYSDATETIMEOFFSET() AT TIME ZONE 'Central Standard Time', 108))                        
  BETWEEN   CONVERT(VARCHAR(5),column_name,108) AND CONVERT(VARCHAR(5), DATEADD(mi, 30,column_name),108)      
 
PREVIOUS NEXT
Tagged: #SQL #Server #query #data #date #time
ADD COMMENT
Topic
Name
3+2 =