<pre><code>No need to use search in this case.

{% set results = craft.entries.videoField(':notempty:').orderBy('postDate desc').one() %}
</code></pre>

CC BY-SA 4.0
2020-09-28T07:35:28.470Z
Thanks, it works!
Matthias
CC BY-SA 4.0
2020-09-26T16:26:56.663Z
2020-09-26T16:26:56.663Z
Pavel Pavlovich
<p>I would like to set up a query to find the latest news article that has a video attached to it ('video' is a matrix field with a block type that is also called 'video' and a field called 'videoUrl').</p>
<p>I know I can use the following query, but I get stuck defining searchQuery. Or is there another method?</p>
<p>{% set results = craft.entries()
.search(searchQuery)
.one() %}</p>

CC BY-SA 4.0
2020-09-25T14:08:50.957Z
There seems to be a similar question/answer over here: https://craftcms.stackexchange.com/a/27297/526 that should put you on the right path!
dmatthams
<search><query>
Query entries with latest video field containing a URL
# Query entries with latest video field containing a URL

(Asked by: username_0 on 2020-09-25)

I would like to set up a query to find the latest news article that has a video attached to it ('video' is a matrix field with a block type that is also called 'video' and a field called 'videoUrl').

I know I can use the following query, but I get stuck defining searchQuery. Or is there another method?

{% set results = craft.entries()
.search(searchQuery)
.one() %}

**Tags:** search, query
> **Comments:**
> **username_1**: There seems to be a similar question/answer over here: https://craftcms.stackexchange.com/a/27297/526 that should put you on the right path!  

---

## 1 answers

### Answer by username_2 on 2020-09-26. Score: 2 | Accepted answer

No need to use search in this case.

{% set results = craft.entries.videoField(':notempty:').orderBy('postDate desc').one() %}

> **Comments:**
> **username_0**: Thanks, it works!  

---

