Re: Calculating time
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Sun, 22 May 2005 13:56:07 -0500
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]
.
- References:
- Calculating time
- From: DianeandChipps
- Calculating time
- Prev by Date: Re: Previous record
- Next by Date: Re: First row has customer name, subsequent rows the name field is
- Previous by thread: Re: Calculating time
- Next by thread: how to link or bind a listbox to textbox
- Index(es):
Relevant Pages
|