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:%'