Thanks for the quick reply, geoffb.
I’ve actually managed to (sort of) get what I want by doing this:
(striptime(date(now)) - striptime(file.ctime)).days AS TimeVariable
so TimeVariable now shows an integer number, which was the goal.
I’ve even tested to multiply it to a negative number and it works with the code below:
(striptime(date(now)) - striptime(file.ctime)).days * (-0.4) AS TimeVariable
TimeVariable will shown a negative decimal number, which is totally OK and my intention
However, now for some reason, if I use TimeVariable in a calculation with another field, I’m having issues. The full query looks like this:
TABLE
Status,
uid,
choice(
(
Impact = NULL OR
Urgency = NULL
),
0,
Impact + Urgency - 1
) AS Priority
,
(striptime(date(now)) - striptime(file.ctime)).days * (-0.4) AS TimeVariable
,
(Priority + TimeVariable) AS Result
FROM
#task
WHERE
Done = false AND
BlockedByTask = NULL AND
HideUntil < date(now)
SORT
Priority
LIMIT
5
So, I have the columns Status, uid, Priority, TimeVariable and Result. However, Result should be a simple sum of a decimal value with an integer and it does not work; instead of showing the result, it simply shows an hifen (‘-’)
PS: Impact and Urgency variables are in the frontmatter and always has integer values from 1 to 3
Any other ideas? Thanks again