SELECT cast(convert(char(10),getdate(),120)+' 00:00:00' as datetime)--取0點
SELECT cast(convert(char(10),getdate(),120)+' 23:59:59' as datetime)--取24點
整合
SELECT * FROM MS_YJ01 where KDRQ between cast(convert(char(10),getdate(),120)+' 00:00:00' as datetime) and cast(convert(char(10),getdate(),120)+' 23:59:59' as datetime) ;