Calculate a datedif with a calculate date

What I’m trying to do

I’m trying to calculate the next date of an event that happens every 28 days, during several days. It is noted with an inline dataview field “event:: true” in my daily note. I found a query to calculate the next date with this :

```dataviewjs
LIST WITHOUT ID dateformat(file.cday + dur("28 days"), "dd-MM-yyyy")
FROM "08📆 Journal"
WHERE event
SORT date DESC
LIMIT 1
```

But now I’d like to have the number of days between today and the next event in another query, for example.
I’d also like to be able to replace it with an inline dataviewjs query to save space and put both pieces of information on a single line.

Things I have tried

I tried with this request:

```dataview
LIST WITHOUT ID dur(date(today) - dateformat(file.cday + dur("28 days"), "dd-MM-yyyy"))
FROM "08📆 Journal"
WHERE event
SORT date DESC
LIMIT 1
```

But I get this error code:

Do you have any solutions?

Thank you in advance.

If other people are looking, I finally succeeded with :
I finally successfull with LIST WITHOUT ID dur(file.cday + dur(“28 days”) - date(today))`

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