If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Getting hour value in informix

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-21-08, 10:24
denizcaglar denizcaglar is offline
Registered User
 
Join Date: Dec 2008
Posts: 12
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.
Reply With Quote
  #2 (permalink)  
Old 12-21-08, 12:11
ibm.ids ibm.ids is offline
Registered User
 
Join Date: Nov 2008
Posts: 64
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 14:14.
Reply With Quote
  #3 (permalink)  
Old 12-21-08, 16:48
denizcaglar denizcaglar is offline
Registered User
 
Join Date: Dec 2008
Posts: 12
Thank you very much
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On