select * from blocks
where type = 'i'
and subtype = 't'
and markdown like '%[ ]%'
and root_id in (
select id from blocks
where type='d'
and ial like '%custom-dailynote-%'
and created < strftime('%Y%m%d000000', 'now', 'localtime')
-- and created < strftime('%Y%m%d000000', datetime('now', 'localtime'))
)
-- 获取日期函数
-- SELECT strftime('%Y-%m-%d %H:%M:%S', 'now', 'localtime', '-1 day');
-- SELECT strftime('%Y-%m-%d %H:%M:%S', datetime('now', 'localtime', '-1 day'));