Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010
    Posts
    2

    Question Unanswered: How to convert character field to 24 hour time format?

    I have a strange problem. When I perform the following query against my logins table, I receive the results in 24 hour format:

    select login_name, login_time from logins

    login_name login_time
    jimbob 16:11
    jimbob 16:13
    jimbob 16:22

    However, when I include a where statement, the results show the real value in that field:

    select login_name, login_time from logins
    where login_date = today

    login_name login_time
    jimbob 04:11 PM
    jimbob 04:13 PM
    jimbob 04:22 PM

    Here is my table schema:

    create table "informix".logins
    (
    login_name char(10),
    login_date date,
    login_time char(8),
    );

    How can I run my query with the where statement and have my output appear in 24 hour format like the first query? Any help you could provide would be greatly appreciated!

  2. #2
    Join Date
    Feb 2010
    Posts
    2
    Well, found the problem with my strange output. Turns out the first query selects all records. The first group of records displayed were entered into my table in 24-hour format. When looking at the records displayed in the second query, the records truly appear in 12-hour format with the AM and PM listed.

    However, is there still a way to convert the data displayed in my second query to a 24-hour format while leaving the actual records themselves in 12-hour format? Thanks!

Posting Permissions

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