Using formulas in DataSets

Hello Support,

I have a question that I hope you will be able to answer.
I want to create a digital schedule where I want to see the following information:

Conference room (name), company name, start time - end time, status (not started, on-going, ended).

Is there any way to calculate the “status” - if current time more or equal than “start time” then status is “on-going”, if current time less than “start time” then status is “not started” etc?

Thanks in advance,
Sergey

1 Like

Yes, there is.

SQL SENTENCE is:

SELECT start time,
CASE
WHEN CURRENT_TIME() >= ‘start time’ THEN ‘on-going’
ELSE 'not started ’
END
FROM datasetTable;

Xibo formula is:

CASE WHEN CURRENT_TIME() >= start time THEN ‘on-going’ ELSE ‘not started’ END

You can find more information in:

Hi Jonatan,

Thank you for your feedback!
Could you explain a little bit more how to add this function correctly.
I tried to add this formula in the DataSet column, but it seems to be is incorrect, look at the screenshot below:

Check your syntax
It works, I tried it myself


I think I found an error
Xibo forum changes the font family, see the picture.

Morning all!

I can’t understand what I’m doing wrong:



May it depend on PHP or MySQL version?

Thanks,
Sergey

I opened phpmyadmin to try to use this script and got the following error

It means like - “unknown operator near the CASE”

Managed to get the following request:
SELECT Start,
CASE
WHEN CURRENT_TIME() >= ‘start time’ THEN ‘on-going’
ELSE ‘not started’
END
FROM dataset_1;


And tried to copy this one into the Xibo


It doesn’t work…:smirk:

Now it works



I don’t know what exactly I changed…

It seems to be there is an error in formula, it doesn’t change the result
SELECT Start,
CASE
WHEN CURRENT_TIME() >= ‘Start’ AND CURRENT_TIME() < ‘End’ THEN ‘on-going’
ELSE ‘not started’
END FROM dataset_1



(now 10.27 AM)

1x
As I told you: Is a syntax error

The apostrophe is not the same thing as the single quote.

quotemarksnewfinal


There isn’t error.
Check the default time zone in PHP.

In PhpMyAdmin–>SQL Sentence

SELECT NOW();