Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to query date in sql server

select  *
from events
where event_date between '2020-01-01' and '2020-01-31';

-- can include time by specifying in YYYY-MM-DD hh:mm:ss format:
select  *
from events
where event_date between '2020-01-01 12:00:00' and '2020-01-01 23:30:00';
Comment

PREVIOUS NEXT
Code Example
Sql :: sql date format dd-mm-yyyy 
Sql :: sql convert datetime to year 
Sql :: delete database mysql command 
Sql :: python mysql query where 
Sql :: SQL Multiple Cases 
Sql :: show column names in sql table 
Sql :: ERROR 1046 (3D000): No database selected 
Sql :: oracle drop sequence 
Sql :: version and edition of SQL Server Database Engine 
Sql :: create delete procedure mysql 
Sql :: get primary key of last inserted record sql server 
Sql :: dual in db2 
Sql :: mysql age by birthdate 
Sql :: mysql delete entire row on condition 
Sql :: oracle index hint 
Sql :: r rmysql connect local database Plugin caching_sha2_password could not be loaded 
Sql :: sql order by multiple columns 
Sql :: error code 1215 cannot add foreign key constraint 
Sql :: postgres top 10 
Sql :: sql change data type 
Sql :: get the location of where postgres database is stored 
Sql :: how to find special characters in sql 
Sql :: nosql vs sql 
Sql :: what is a query in sql 
Sql :: limit offset sql server 
Sql :: add not null constraint sql server 
Sql :: sql select row with max date 
Sql :: mysql case when in select 
Sql :: add foreign key to existing table postgres 
Sql :: postgresql change user role grant 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =