Page 3 of 3 FirstFirst 123
Results 31 to 43 of 43
  1. #31
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Click image for larger version. 

Name:	1.jpg 
Views:	10 
Size:	54.3 KB 
ID:	11344

    The screen scrape shows how to enter the function in the query design grid. (Click on it for full size.)

    If you examine the generated SQL, it's very much as Orange specified. (Note he tested for >0 and I test for <0)



    If you want a VBA solution then post back.

  2. #32
    TOMMY.MYERS668's Avatar
    TOMMY.MYERS668 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    West Virginia
    Posts
    77

    Re: How do I calculate in Military time

    Ty I copied that to help me better understand sql. I allready know the vb. Thanks for the screenshot.

  3. #33
    bjnorth is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Posts
    19
    thanks Tommy...okay I have a dumb question. I can't seem to find the code. I am looking in the form design and don't see it. All I can find is the name of the field. Duh.....

  4. #34
    TOMMY.MYERS668's Avatar
    TOMMY.MYERS668 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    West Virginia
    Posts
    77

    Military time

    In design mode on far right of toolbar should be a button that says view code. Also u can highlight end call time entry block view propertied. Then in event tab hit the three dots beside after update

  5. #35
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    What happens if the Call is received say on Friday 10:00 PM and is cleared Sunday at 3:00 AM?

    The code that I showed previously, and the function in Tommy's post only deal with going past midnight into the next day.

    This may be a real shortcoming in some situations.
    I think you should store the data and time for each of the Received and Cleared data.
    But if you are going to clear all calls - at the very latest - the next day, then go for it.

  6. #36
    bjnorth is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Posts
    19
    Hi Rod,

    Thanks so much for all of your help. You're awesome. I would love to know the VBA code as well cuz I need to learn it also.


  7. #37
    TOMMY.MYERS668's Avatar
    TOMMY.MYERS668 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    West Virginia
    Posts
    77

    Military time

    Orange I kinda thought of that but were kind of dealing with shift work so probably 14 hours at max and then your releived like if u had a standoff situation.

  8. #38
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    As I said, there could be a basic flaw in the design if the call goes into the second day or longer after call received.
    But if you know this, and it's not an issue, then carry on.

  9. #39
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Hi Orange. Agree with your concerns. bjnorth has placed formats on the CallReceived and CallCleared field definitions to allow only a time to be entered but how safe is that? IMHO what should happen is that the form should (?) have three fields - date, received and cleared - but that the table should only have two - received and cleared - both of which are true date/time values, the date being added to time received and time cleared. In this way there are no problems with negative durations and calls lasting longer than 23 hours and 59 minutes.

  10. #40
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Yes, that's what I was trying to suggest.
    And that way multiple days between received and cleared ir only a few minutes --doesn't matter and is a simple calculation.

  11. #41
    TOMMY.MYERS668's Avatar
    TOMMY.MYERS668 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    West Virginia
    Posts
    77

    Calc military time

    Ok... And if you add a full date field to the call cleared I assume that ypu could.make the default be the same day but if it detects that the cleared time is less than the received time then you cold have an input box popup that asks the day the call was cleared during input. Such as in :
    After update
    If callcleared is &lt; callreceived then
    Inputbox select date call cleared and append the new date to call cleared but keep the time. then that should allow it to span multiple days correct?

  12. #42
    TOMMY.MYERS668's Avatar
    TOMMY.MYERS668 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    West Virginia
    Posts
    77

    Calc military time

    Sorry im on my phone it doesnt like it when I try to type code symbols.

  13. #43
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    The fundamental point is that individual fields have to be defined in a manner that addresses the requirement.
    In the example being discussed A Call is Received at XX Hours on XXX Day, and that Call is Cleared (Completed) at YY Hours on YYY Day. Most often YYY Day and XXX Day are the same, but not always.

    If the requirement is to record all Calls and to present/display/report each Call Duration when the Call is Cleared or at some later date (monthly reports etc), then recording the full date and time of the Call Received and Call Cleared makes the calculation is straightforward.

    If on a data entry form you want XXX to be the default Day for Call Cleared, that's fine. If you have to adjust YYY, do so, but record YYY Day and YY Hour with the Call Cleared. On the form you could have some control to add W days to the XXX default, to get the adjusted value for YYY. I'm sure there are many ways to do this with controls and logic related to the form.

    Just some thoughts for consideration.

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Import Wizard does not start from time to time
    By emmett in forum Import/Export Data
    Replies: 1
    Last Post: 04-06-2012, 07:16 AM
  2. Calculate start time.
    By Mantaii in forum Reports
    Replies: 5
    Last Post: 02-28-2012, 12:31 PM
  3. Replies: 7
    Last Post: 08-04-2011, 07:49 PM
  4. Military Time
    By tshirttom in forum Access
    Replies: 3
    Last Post: 07-29-2011, 01:29 PM
  5. auto start/stop time
    By j0ker21m in forum Reports
    Replies: 1
    Last Post: 12-10-2005, 08:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums