Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Posts
    16

    Question Unanswered: CAST function on Informix 7.20

    My company is using an Informix DBMS version 7.20 on a SCO Unix machine (should be version 5). I want to convert a DATE field to CHAR data type for comparision.

    For example, the DATE field named TheDate, with data '2001/02/20'. I want it output as 0220.

    However, I cannot use TO_CHAR and CAST functions.

    Anybody know if there is any similar function I can use in the SQL command?

    Thanks

  2. #2
    Join Date
    Aug 2002
    Location
    Belgium
    Posts
    534
    You can use square brackets. I think it's something like this:

    Select thedate[6,2] || thedate[9,2]
    from table...
    rws

  3. #3
    Join Date
    Aug 2002
    Posts
    16
    I think square brackets work only for text. How can I change the DATE field to a TEXT type.

    Originally posted by Roelwe
    You can use square brackets. I think it's something like this:

    Select thedate[6,2] || thedate[9,2]
    from table...

Posting Permissions

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