table name : dbo.tbBas_Subject
datefiled: CreateDate
data: 2006-10-27 15:46:02.937 <时间格式>
时间段查询 select top 4 * from dbo.tbBas_Subject where
CreateDate between '2006-10-27 15:46:02.937' and '2006-10-27 16:17:15.377'
时间点查询 select * from dbo.tbBas_Subject where CreateDate='2006-10-27 16:17:15.377'
模糊查询 select * from tbBas_Subject where Convert(Varchar(10),CreateDate,120) like '2006-10-%'
select * from tbBas_Subject where Convert(Varchar(23),CreateDate,120) like '2006-10-27 15:%'
select * from tbBas_Subject where Convert(Varchar(23),CreateDate,120) like '2006-10-27 %46:%'
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/fly_bird2008/archive/2007/09/06/1774409.aspx
datefiled: CreateDate
data: 2006-10-27 15:46:02.937 <时间格式>
时间段查询 select top 4 * from dbo.tbBas_Subject where
CreateDate between '2006-10-27 15:46:02.937' and '2006-10-27 16:17:15.377'
时间点查询 select * from dbo.tbBas_Subject where CreateDate='2006-10-27 16:17:15.377'
模糊查询 select * from tbBas_Subject where Convert(Varchar(10),CreateDate,120) like '2006-10-%'
select * from tbBas_Subject where Convert(Varchar(23),CreateDate,120) like '2006-10-27 15:%'
select * from tbBas_Subject where Convert(Varchar(23),CreateDate,120) like '2006-10-27 %46:%'
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/fly_bird2008/archive/2007/09/06/1774409.aspx