前提:
需要查询数据库表中的某个datetime类型的字段加22天后在某个时间范围内的数据
需要使用函数 date_add(字段名,interval 22 day)
例如:
select * from 表名 where DATE_ADD(expenditure_completion_time,interval 22 day) between '2024-03-01' and '2024-06-30'
查询某个datetime的时间和某个具体时间差22天的数据,使用函数datediff
DATEDIFF(date1, date2)