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

    Military Time Conversion (2002)

    Hi,

    I have a table that is imported in from Excel. One of the fields in the table contains the item [from_time]. The format when it comes in from excel is as text and it is in military time. I need to make this AM/PM time. I first tried resetting the format in the table as medium date format from text but all that happened was that it deleted the data that was in the table for that field. I then thought maybe I could use an append/update query to do this (but am never quite sure which does which). I started by creating another table that has a field for military time and another field for the corresponding AM/PM time. Now I'm lost. I don't know how to convert the times in the original table using this conversion, or if I'm even on the right track for that matter.

    Thanks,
    Leesha

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Military Time Conversion (2002)

    <P ID="edit" class=small>(Edited by Francois on 15-Oct-04 00:09. Add assuming)</P>I'm assuming that military time is something like 15:30 or 23:30
    In the table containing the military time add a new field and make it Date/Time type.
    In the format property enter : hh:nn am/pm
    Create a new query with one field: your new date/time field.
    In the menu Query, select Update Query.
    In the query grid in the line Update To enter : CDate([MilitaryTimeField]). (see attachment)
    In the menu Query, select Run.
    You have now your new date/time field

    Make a copy of your table or DB before trying it, in case something goes wrong.
    Francois

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Military Time Conversion (2002)

    If the military time is something like : 1530 or 2315
    Use in the Update To Line:
    CDate(Left([MilitaryTime],2) & ":" & Right([MilitaryTime],2))
    Francois

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

    Re: Military Time Conversion (2002)

    All I can say is OMG!!! WOW!!!!!

    Thanks so much,

    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
  •