Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2013
    Posts
    1

    Unanswered: variables in informix

    Hi I'm new to informix and I need to do the following query but in informix:

    DECLARE @mes int;
    SET @mes=(
    Case when MONTH(GETDATE())-1= 0
    Then 12
    Else
    MONTH(GETDATE()-1)
    END)


    I understand that it should start like this:
    DEFINE mes int;
    LET mes = SELECT DISTINCT MONTH(TODAY-1) FROM systables ;
    But i get errors

    And how do I put the case statement?

    hope you can help me guys!

    Thanks

  2. #2
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Is this Informix 4GL ? Stored Procedure, ESQL/C ?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •