凡软中sql,控制时间为两个月前的第一天到今天怎么表示
select * from tabname where 1=1 and time_t between '${DATEINMONTH(MONTHDELTA(today(),-2),1)}' and '${today()}'
select * from tabname where 1=1 and time_t between
'${DATEINMONTH(MONTHDELTA(today(),-2),1)}'
and
'${today()}'
sql server 中。
select CONVERT(date, CONVERT(varchar(10),DATEADD(m,-2 ,dateadd(dd,-day(getdate())+1,getdate())) ,112)),CONVERT(date,getdate())