Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I have a filed in my DB which contain the Date with the stamp, If I put the colun in a chart or table I can see the timestamp but if I create a text box to display thre date is display only -.
I need to calculate the number of hours between the time now() and my date from my DB and display red if is more then 12h or green if is < 12h.
I have tried
=if(Num(Hour(interval(now()-Date)))>'12:00:00','Red','Green') but this is not right.
Regards,
How about this
=If((Now() - Date) > MakeTime(12), 'Red', 'Green')
expression working in text box
=if(Num(Hour(interval(now()-Date)))>'12:00:00','Red','Green')
what is your timestamp format
A few preliminary remarks:
BTW the simplest expression is probably this (on condition that Date has but a single correct DateTime value):
=IF (LocalTime() - Date > 0.5, 'Red', 'Green')