How to use 'AND' function in DATAVIEW

What I’m trying to do

I’m trying to create a query that would help me search for files that have ‘#writing’ and '#Sprout".
I am assuming that the AND function will be used but I’m not to sure how.

Things I have tried

Here is the kind of file that I am trying to search for:

Here is an example query that I have tried:

Thank you guys!

Try this:

TABLE
FROM #Writing AND #Sprout
1 Like

You’re correct that you can use AND function in Dataview but you can’t use it internally in the parameters of a function call. So the proper way to do it would rather look like:

```dataview
TABLE 
WHERE contains(tags, "#writing")
  AND contains(tags, "#???Sprout")
```
Bonus tip: How to present code properly in a forum post

If you want to showcase either markdown, or code blocks, or dataview queries properly in a forum post, be sure to add one line before and one life after what you want to present with four backticks, ````. This will ensure that any other backticks (like in code blocks or queries) is properly shown.

1 Like

Thanks to you too!

Much appreciated Denna.

1 Like

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