Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008
    Posts
    12

    Unanswered: Getting hour value in informix

    Hi

    How can we get the hour value of a datetime value in informix ?

    For example i need to get 05 from '18.12.2008 05:10:00'

    Thanks.

  2. #2
    Join Date
    Nov 2008
    Posts
    65
    Provided Answers: 1
    You can try using cast:

    Code:
    select current, current::datetime hour to hour from
    systables where tabid=1
    If you need int type as result, you can use couple more of casts:

    Code:
    select current, current::datetime hour to hour::char(2)::int from
    systables where tabid=1
    HTH
    Last edited by ibm.ids; 12-21-08 at 15:14.

  3. #3
    Join Date
    Dec 2008
    Posts
    12
    Thank you very much

Posting Permissions

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