Simple date arithmetic

Attempting to get my head round Tinderbox for about the fifth time.

Trying to set a query to get all notes with a DueDate in the next seven days. This should be easy but is beyond me. Started off with $DueDate>date(“Today”)&$DueDate<date(“Today”+“7 Days”) and tried variations on this theme. Cannot find anything in the Help or online.

About to give up for the fifth time.

John

Try getting rid of the quotes around “Today” and “7 days”

I have this expression in a “Due Items” query, and it works fine:

$DueDate<=date(today)

Good luck!

Update: just tested using $DueDate<date(today + 7 days) and that also worked fine. I think it’s the quotes.

1 Like

Thanks, that works. I put the quotes in because the screencast I watched used quotes for $DueDate==date(“Today”).

Phew! Glad it worked.

The date() operator takes a string and converts it to a date.

date(“today”)
date(“today+7 days”)

In your case, evaluating “Today”+“7 Days” gives a result of “Today7 Days”, which Tinderbox can’t understand.

Suggestion: When puzzled by a date query like this, make a new Tinderbox file with a few notes. Select one, and make MyDate a key attribute. Type your date expression-- whatever text you’re feeding to date() – into the key attribute field.

Suggestion: When puzzled, ask here. You’re likely to get good advice on puzzles like this one, often very quickly.