Calculate how many days

hello everybody
in a view with name โ€œinopโ€ i have a list with of the means inoperative e the date.
how do I calculate how many days are inoperative?
thanks

0 12 1,055
12 REPLIES 12

Steve
Platinum 4
Platinum 4

Please clarify.

Excuse me.
In a filter slice the computers that are inoperative.
I would like to see how long they remain inoperative in days

If the out-of-service/inoperative time is in a Date-type column, you can compute the number of days with:

(TODAY() - [DateColumn])

If the out-of-service/inoperative time is in a DateTime-type column, you can compute the number of days with:

ROUND(HOUR(NOW() - [DateTimeColumn]) / 24.0)

ok!
but can i add this formula olso in a virtual column?

@Cannone_Cannone
Yes you can. Itโ€™s an expression at the end.

Sorry
but when I enter the formula in the virtual column I get this error
Column Name โ€˜how many daysโ€™ in Schema โ€˜GSE_Schemaโ€™ of Column Type โ€˜DateTimeโ€™ has an invalid app formula โ€˜= ROUND (HOUR (NOW () - [days]) / 24.0)โ€™. Arithmetic expression โ€˜(NOW () - [Days])โ€™ has inputs of an invalid type โ€˜Unknownโ€™

Your [days] column is probably not a DateTime field.

I confirm that I have a column set to datetime

I may be completely off base here, but does your NOW() expression have a space before the brackets? Your post is showing your expression error as NOW_()?

Might not be the cause and just the way the error is reportedโ€ฆ

perfect!!! tanks a lot!

one last thing
the virtual column how should I set it?
data, data time, text

There is a way to only count the days when the status column is = โ€œinopโ€

Top Labels in this Space