Dataview block vs inline query

I’m trying to return a specific set of note links. I’ve discovered that using an inline JS query can return a comma separated list, which is the format I really want, rather than a bullet list or table.

This code block produces the list I want:

FROM "Calendar/Daily" AND #monthlyreview
WHERE >= date(2023-01-01) AND < date(2023-01-31)

The inline JS version doesn’t work, however, but is what I need:

`$= dv.pages('"Calendar/Daily" AND #monthlyreview').where( >= date(2023-01-01) AND < date(2023-01-31))`

The error I get for the latter says"
Dataview (for inline JS query 'dv.pages('"Calendar/Daily" AND #monthlyreview').where( >= date(2023-01-01) AND < date(2023-01-31))'): SyntaxError: missing ) after argument list

but the formatting looks correct to me.

I’ve tried looking on the forums and everywhere else Google will send me. I’ve also tried various forms of the .where portion, including page => which it doesn’t like because Octal literals in 'strict mode' whatever that means (can you tell I know just enough to be dangerous?). I’ve also tried every form of quote wrapping, dataformatting, etc., that I can find to try or think of.

Does anyone know why the block works but the inline doesn’t and help me get the inline working?

Regular queries use the Dataview query language. DataviewJS is embedded JavaScript, which uses a very different syntax.

I think this might be close to what you’re trying to do:

$= dv.pages('"Calendar/Daily" AND #monthlyreview').where(page => >="2023-01-01") && <"2023-12-31"))

That, my friend, is exactly what I was looking for! That darned…didn’t even occur to me that I should be using that even when I did use the Also works brilliantly with Templater, so I can dynamically create my monthly review note!

Thanks for your help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.