Results 1 to 2 of 2
  1. #1
    w2vijay is offline Novice
    Windows XP Access 2000
    Join Date
    Feb 2010
    Location
    India
    Posts
    5

    Calculate Time and Display Records

    Hi,
    I want to calculate time difference between two time fields and display new record with time difference. Below given in the sample record in data base and what is the expected.
    Date format is DD/MM/YY
    Time is 24 hr format : Ex: 23:45 PM
    record present in data base with
    Date BeginTime EndTime
    28/01/10 23:30 5:30
    Output should be
    Date Begintime EndTime Hours Minutes
    28/01/10 23:30 00:00 00 30
    29/01/10 00:00 05:30 05 30


    For each record in data base the report should
    1.first check the date and begin time.
    2.If the begin time is less than 24 hours calculate the difference and display one record
    3.and if end time crossed 24 hours(next day)
    4.calculate time difference from 24 to end time and display another record
    Note: The time is in 24 hour format. User will enter time as 22:15, 11:30 etc

    Please let me know if you need more details.

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    Take a look at the "DateDiff" and "DateAdd" functions in Access Help. They are what you need.

    To account for a date rollover or day before, use the DateAdd function to add or subtract a day from a date.

    If you can articulate the question, you can code the answer.
    Last edited by llkhoutx; 02-12-2010 at 01:59 AM. Reason: Grammar correcton

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Display all records
    By skwilliamson in forum Queries
    Replies: 3
    Last Post: 12-02-2009, 12:17 PM
  2. Display last five records only
    By premdasp in forum Queries
    Replies: 3
    Last Post: 11-18-2009, 11:53 AM
  3. Subform records wont display
    By taylorosso in forum Forms
    Replies: 10
    Last Post: 10-09-2009, 08:59 AM
  4. checkboxes to display records
    By jamie123 in forum Forms
    Replies: 1
    Last Post: 05-13-2009, 10:43 AM
  5. Replies: 0
    Last Post: 08-07-2008, 07:02 PM

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