From: GWB on
John - this works perfect except the minute are all negative ie... -123

"KARL DEWEY" wrote:

> Try this --
> SELECT [YourTable].[DateField], DateDiff("n", [YourTable].[DateField],
> (SELECT TOP 1 [XX].[DateField] FROM YourTable AS [XX] WHERE
> [YourTable].[DateField] > [XX].[DateField] ORDER BY [XX].[DateField] DESC))
> AS Run_Time
> FROM YourTable
> ORDER BY [YourTable].[DateField];
>
>
> --
> Build a little, test a little.
>
>
> "GWB" wrote:
>
> > I need to get run time in minutes from between a series of date/time stamps.
> > I have no clue of how to do this.. any help would be greatly appreciated
> >
From: John W. Vinson on
On Fri, 16 Apr 2010 06:41:01 -0700, GWB <GWB(a)discussions.microsoft.com> wrote:

Well, not sure if you were replying to me or to Karl but... just reverse the
order of [yourtable].[datefield] and the subquery, or put a minus sign before
the datediff.

>John - this works perfect except the minute are all negative ie... -123
>
>"KARL DEWEY" wrote:
>
>> Try this --
>> SELECT [YourTable].[DateField], DateDiff("n", [YourTable].[DateField],
>> (SELECT TOP 1 [XX].[DateField] FROM YourTable AS [XX] WHERE
>> [YourTable].[DateField] > [XX].[DateField] ORDER BY [XX].[DateField] DESC))
>> AS Run_Time
>> FROM YourTable
>> ORDER BY [YourTable].[DateField];
>>
>>
>> --
>> Build a little, test a little.
>>
>>
>> "GWB" wrote:
>>
>> > I need to get run time in minutes from between a series of date/time stamps.
>> > I have no clue of how to do this.. any help would be greatly appreciated
>> >
--

John W. Vinson [MVP]