4 Replies Latest reply: May 10, 2017 1:54 PM by Oleg Troyansky RSS

    how to use case statement in query using sqlbase database

    M. Coolen

      Hello,

       

      I am trying to carry out a case statement in the SQL section using a SQLBase database but I cannot find the correct syntax.

      Can anybody help me finding the correct syntax. What I want to do is concatenate a zero if the period is smaller than 10.

      Example: If the periode is 9, I want to use 09.

       

      I tried:

       

      LOAD

           Bookyear,

           Period;

      SQL Bookyear,

           Periode

           CASE

                WHEN period < 10

                THEN (0||periode)

                ELSE (period)

                END as Period

      FROM CROPEN

       

      Thank you for helping me with this issue.