首页 >> sql语句 >> 详细内容
sql语句
 
sql语句 >> 正文
查询日期
日期:2017/6/15 

 查询出生年月为“1983-1-24“的学生
 Select * from biao where 出生日期=’1983-1-24’(数据库为SQL Server)
 Select * from biao where 出生日期=#1983-1-24#(数据库为ACCESS)
 
 查询时间段 “select * from biao where 日期>=’”+mydate1+”’and 日期<=’” + mydate2 + “’ order by 日期”
 或用between实现“select * from biao where 日期 between ’”+mydate1+”’and’” + mydate2 + “’ order by 日期”

 日期函数 getdate()返回当前日期与时间 year() day() moth()