What SQL queries are supported in flipabit

Hello everyone,

I would like to make a SQL query but it seems that some sql functions are not supported by flipabit. Could someone tell my what kind of sql functions are supported ?

Here is my query :
SELECT *, “color1.png” color FROM data WHERE “Repetition” = “Weekly” AND “Days” LIKE DAYNAME()

Thats for an icon that must be displayed only some days of the week. So in my database I have a “Days” field that contents all the days the icon must be displayed.

But it seems that DAYNAME() doesn’t work with flipabit… Same goes for MONTH() or YEAR(). That’s strange because the function DATE() is supported, by example. How can I do then ?

Thanks by advance

I tried using “document.currentDayOfWeekName” in my SQL query, but it doesn’t work either…

что это ? What is this ?

That’s the icon name. I have a PNG file that must be displayed in an image widget, and that widget is connected to a database, with this query.

1.Функция DAYNAME() Возвращает имя дня недели, такой запрос у Вас пуст, тоесть функция ничего не возвращает.
2. SELECT … FROM здесь указываютя именя полей.
3. “Repetition” = “Weekly” AND “Days” - Это вообще не понятное условие

  1. Function DAYNAME() Returns the name of the day of the week, your query is empty, that is, the function does not return anything.
  2. SELECT … FROM The names of the fields are indicated here.
  3. “Repetition” = “Weekly” AND “Days” - This is not clear at all

Попробуйте так.
Try this.

SELECT *,
CASE
WHEN Repetition='Weekly' THEN 'color1.png'
WHEN Repetition='Days' THEN 'color2.png'
END color
FROM data LIMIT 0, -1

In fact i’m just trying to get the name of the day we are currently… I tried DAYNAME(NOW()) for example, but it doesn not work either…

The name or the number of the day today would be fine, like now we are monday, so I would like to make a query like : “if we are monday today, then icon1.png. If we are tuesday, then icon2.png”.

SELECT *,
CASE CAST (strftime('%w', date) as integer)
when 0 then 'Sunday'
when 1 then 'Monday'
when 2 then 'Tuesday'
when 3 then 'Wednesday'
when 4 then 'Thursday'
when 5 then 'Friday'
END weekday,
CASE CAST (strftime('%w', date) as integer)
when 0 then 'color0.png'
when 1 then 'color1.png'
when 2 then 'color2.png'
when 3 then 'color3.png'
when 4 then 'color4.png'
when 5 then 'color5.png'
END color
FROM data LIMIT 0, -1

Yes, that’s something like that I was looking for ! I finally got something that works, thank you very much Vladimir !


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.