You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i want to use complex sql to implement dynamic query, but didn't get the expected results.
my purpose: dynamically query tasks that were completed last month
query sql:
select*from blocks
where type='i'andpath='/work.md'and markdown like'%[x]%'and (
created between(SELECT strftime('%Y%m%d',date('now','start of month','-1 month'))) and (SELECT strftime('%Y%m%d',date('now','start of month','-1 day')))
or updated between(SELECT strftime('%Y%m%d',date('now','start of month','-1 month'))) and (SELECT strftime('%Y%m%d',date('now','start of month','-1 day')))
)
the result:
Expected result
I don't know how sql parsing is implemented in SiYuan, and just explore whether this complex sql can be used
Screenshot or screen recording presentation
see figure above
Version environment
Version: v1.0.8 / Kernel v1.0.8
Operating system:
Browser (if used):
Log File
null
More information
null
The text was updated successfully, but these errors were encountered:
created and updated is not DATATIME/DATE type, it is TEXT type, so try using < or > comparison operator for it.
I tried it but it didn't work.
query sql
select*from blocks where type='i'andpath='/work.md'and markdown like'%[x]%'and created >=(SELECT strftime('%Y%m%d',date('now','start of month','-1 month'))) and created<=(SELECT strftime('%Y%m%d',date('now','start of month','-1 day')))
by the way, the strftime() function's result type was TEXT
Describe the problem
i want to use complex sql to implement dynamic query, but didn't get the expected results.
my purpose: dynamically query tasks that were completed last month
query sql:
the result:
Expected result
I don't know how sql parsing is implemented in SiYuan, and just explore whether this complex sql can be used
Screenshot or screen recording presentation
see figure above
Version environment
Log File
null
More information
null
The text was updated successfully, but these errors were encountered: