Re: Calculating time

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



DianeandChipps wrote:

>I am trying to work out how long it takes for a query to be resovled. I
>thought I had worked it out but when it takes more than one day to resolve
>the problem I get a negative answer; i.e reponse date & time 16 May 16:00,
>resolution date & time 18 May 09:00. If the query is resolved on the same
>date then I get the correct answer; 16 May 09:00, 16 May 16:10 gives me 430
>minutes. Please can someone let me know whta I am missing from my formula.
>
>(DateDiff("n",([resolution date]-[response date]),([resolution
>time]-[response time])))


Are you storing the Date part and the Time part in two
different places??

Generally a Date type field contains both parts, so the
expression would just be:
DateDiff("n", Responsedatetime, Resolutiondatetime)

If you really do have them in separate places, then you can
do this:
DateDiff("n",[response date] + [response time],
[resolution date] + [resolution time])

That will work because a date/time value is a Double with
the date as the number of days since 30 Dec 1899, and the
time part is the fraction of a day (e.g. noon is .5).
--
Marsh
MVP [MS Access]
.



Relevant Pages

  • Re: RecordSource
    ... >How do I set a subform record source to a query? ... Marsh ... MVP ...
    (microsoft.public.access.formscoding)
  • Re: Ignore null field in calculation
    ... Marsh, ... If you want to use todays date, then the query can use: ... NumDaystoComplete: ... MVP ...
    (microsoft.public.access.reports)
  • Re: Displaying Parameter Input on Report
    ... the query. ... Marsh ... MVP ... Prev by Date: ...
    (microsoft.public.access.reports)
  • Re: Connects query
    ... see how such a simple query could return no records. ... Marsh ... MVP ... Prev by Date: ...
    (microsoft.public.access.queries)
  • Re: Microsoft Cleanliness
    ... preceeds each table with the word TABLE and each query with "QUERY". ... Make sure the import window can't be resized. ... We have a beautiful marsh, Cootes Paradise, here at the west end of Lake ... Ontario but it's been dying for decades because of the invasion of carp, ...
    (comp.databases.ms-access)