Results 1 to 2 of 2

Thread: Time field

  1. #1
    Join Date
    Feb 2003
    Posts
    21

    Unanswered: Time field

    In one of my tables I have a field for time (the field is called hour) and it's stored in the following format:

    - 9:20am is stored as 920
    - 3:30pm is stored as 1530
    - 12:20am is stored as 20
    - 12:05 is stored as 5

    In a Visual Basic application that I am creating I want to call it back in the same sql statement as some other fields.

    Select x, y, z, hour from mytable where x = 10;

    Is it possible to get 'hour' to be in the correct format within this statement?

  2. #2
    Join Date
    Sep 2002
    Location
    MI
    Posts
    19

    Re: Time field

    Originally posted by kieranodwyer
    In one of my tables I have a field for time (the field is called hour) and it's stored in the following format:

    - 9:20am is stored as 920
    - 3:30pm is stored as 1530
    - 12:20am is stored as 20
    - 12:05 is stored as 5

    In a Visual Basic application that I am creating I want to call it back in the same sql statement as some other fields.

    Select x, y, z, hour from mytable where x = 10;

    Is it possible to get 'hour' to be in the correct format within this statement?
    Here is the thing that I have noticed about time, if you rename the colunm time, and get the format to match SQL Server you can do functions against it. The same thing goes for Date.
    Jon Nelson

Posting Permissions

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