如何用sql语句实现下列功能?select*fromawhererq 当前月初日andrq 当前日[解决办法]select * from a w
如何用sql语句实现下列功能?
select * from a where rq> =当前月初日 and rq <= 当前日
[解决办法]
select * from a where rq> =Convert(Varchar(8), GetDate(),120) + '01 ' and rq <= GetDate()
[解决办法]
select * from a where rq between cast(rtrim(year(rq))+ '- '+rtrim(month(rq))+ '-01 ' as datetime) and getdate()
