SQL 获取日记中昨日及之前未完成的任务

SQL获取日记中昨日及之前未完成的任务

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'));

image.png

留下你的脚步
推荐阅读