Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Military Time to Standard Time (2002)

    Hi,
    I've got a query with filed [from_time] that is in military time. I need to convert it to standard time. I tried

    format([from_time],""hh:nn AM/PM") but all I get is 12:00 Am for each instance of [from_time]. What am I missing?

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Military Time to Standard Time (2002)

    See the thread starting at <post#=417,188>post 417,188</post#>, in particular Francois' second reply.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Military Time to Standard Time (2002)

    If you copied and pasted the line, you have an extra double quote in there, which would result in a midnight time.
    Charlotte

  4. #4
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Military Time to Standard Time (2002)

    Hi, I tried this but the answers are correct. Here is the sql:

    UPDATE tblVisitReport SET tblVisitReport.from_time = CDate(Left([from_time],2) & ":" & Right([from_time],2));

    I "think the problem is that the format in the excel spreadsheet before it's imported is in text format not date/time. If I change the format in the table to date/time, the fields doesn't fill in on import.

    Leesha

  5. #5
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Military Time to Standard Time (2002)

    Hi,

    I just rechecked it and it seems to be OK.

    Thanks!
    Leesha

Posting Permissions

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