Colouring in the SQL query field

Hello,

I want to make a dynamic colouring process in order to highlight the DELAYED_TARIH field in my query. If the date is today's date, I want it to remain red if it is a date that is not yet due, I want it to remain green.

I am waiting for your help in this regard, thank you.

SELECT
Caption AS LOKASYONADI,DetailsUrl AS [_LinkFor_LOKASYONADI],
Nodes.CustomProperties.LokasyonNo AS TEMOSNO,
Nodes.CustomProperties.TRANSPOL_HIZ AS TRANSPOL_HIZ,
Nodes.CustomProperties.GECICI_HIZ AS GECICI_HIZ,
Nodes.CustomProperties.GECICI_TARIH AS GECICI_TARIH
FROM Orion.Nodes
where Nodes.CustomProperties.GECICI_HIZ >= 1
and (Nodes.CustomProperties.Department IN
('IL E', 'HT KAPISI', 'YEDEK HAT', 'MERKEZE BAGLI LOKASYON', 'BSSS', 'ANA HAT' , 'KHK', 'DHK', 'HKK' , 'HAVALIMANI'))
order by GECICI_TARIH ASC;

Parents
  • Not sure if there's a way to add color in a sql query box, it'd need to be like [_ColorFor_x] or something

    You can do it in a custom table element, by using CASE with HTML formatting and enabling HTML on the column it results in

    I don't see the 'DELAYED_TARIH' column in your table, I'm sure it's a language thing i'm not getting

    Something like

    SELECT
    CASE
    WHEN timestamp >= GETUTCDATE() THEN CONCAT('<span style="color: #6A5ACD;">', caption,  '</span>')
    ELSE caption
    END as Name

    You'd need to add the URL into that in the same way

Reply
  • Not sure if there's a way to add color in a sql query box, it'd need to be like [_ColorFor_x] or something

    You can do it in a custom table element, by using CASE with HTML formatting and enabling HTML on the column it results in

    I don't see the 'DELAYED_TARIH' column in your table, I'm sure it's a language thing i'm not getting

    Something like

    SELECT
    CASE
    WHEN timestamp >= GETUTCDATE() THEN CONCAT('<span style="color: #6A5ACD;">', caption,  '</span>')
    ELSE caption
    END as Name

    You'd need to add the URL into that in the same way

Children
No Data