Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    Red face Unanswered: Difference in time between two date / time fields

    I have a query which pulls in task information including;

    JobID (Numerical)
    EmployeeID (Numerical)
    StartDate (Date / Time) i.e. 01/05/02 08:00:00 (1st may 8am)
    EndDate (Date / Time) i.e. 02/05/02 15:40:00 (2nd may 3.40pm)

    I want to calculate the duration in MINUITES

    i.e. the answer i want is 1900 (minuites)

    Can I do this by adding a calculated field in the query or do I need a module?

    Any pointers folks?

    HERE IS THE CURRENT QUERY>

    SELECT tblAssignments.EmployeeID, tblAssignments.JobID, tblAssignments.Activity, tblAssignments.StartDate, tblAssignments.EndDate, activit.TASKBARCOL, [First_Name] & " " & [surname] AS EmpName
    FROM employ INNER JOIN (tblAssignments INNER JOIN activit ON tblAssignments.Activity = activit.TASK) ON employ.PAYROLL_NO = tblAssignments.EmployeeID;

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    I have lost the plot

    And the answer is...

    SELECT tblAssignments.EmployeeID, tblAssignments.JobID, tblAssignments.Activity, tblAssignments.StartDate, tblAssignments.EndDate, activit.TASKBARCOL, [First_Name] & " " & [surname] AS EmpName, DateDiff("n",[startdate],[enddate]) AS Duration
    FROM employ INNER JOIN (tblAssignments INNER JOIN activit ON tblAssignments.Activity = activit.TASK) ON employ.PAYROLL_NO = tblAssignments.EmployeeID;


    The duration bit being...
    DateDiff("n",[startdate],[enddate]) AS Duration

Posting Permissions

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