select * from `ht_invoice_information` where year(create_date)=year(date_sub(now(),interval 1 year));
select * from 表名 where to_days(时间字段名) = to_days(now());
select * from 表名 where to_days( now( ) ) - to_days( 时间字段名) <= 1
select * from 表名 where date_sub(curdate(), interval 7 day) <= date(时间字段名)
select * from 表名 where date_sub(curdate(), interval 30 day) <= date(时间字段名)
select * from 表名 where date_format( 时间字段名, '%y%m' ) = date_format( curdate( ) , '%y%m' )
select * from 表名 where period_diff( date_format( now( ) , '%y%m' ) , date_format( 时间字段名, '%y%m' ) ) =1
select * from `ht_invoice_information` where QUARTER(create_date)=QUARTER(now());
select * from `ht_invoice_information` where QUARTER(create_date)=QUARTER(DATE_SUB(now(),interval 1 QUARTER));
select * from `ht_invoice_information` where YEAR(create_date)=YEAR(NOW());
select * from `ht_invoice_information` where year(create_date)=year(date_sub(now(),interval 1 year));
SELECT name,submittime FROM enterprise WHERE YEARWEEK(date_format(submittime,'%Y-%m-%d')) = YEARWEEK(now());
SELECT name,submittime FROM enterprise WHERE YEARWEEK(date_format(submittime,'%Y-%m-%d')) = YEARWEEK(now())-1;