Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 49E319FB28D for ; Fri, 3 Nov 2006 16:44:35 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 75119-08 for ; Fri, 3 Nov 2006 16:44:28 -0400 (AST) X-Greylist: delayed 00:15:04.03939 by SQLgrey- Received: from netmadeira.com (smtp1.netmadeira.com [213.190.195.202]) by postgresql.org (Postfix) with ESMTP id 979D49FB274 for ; Fri, 3 Nov 2006 16:44:27 -0400 (AST) Received: from oem41cbbf9e178 (unverified [213.190.214.35]) by netmadeira.com (NetMadeira Mail Server Version:2.2G2@SV32) with ESMTP id 174733796-1906088 for ; Fri, 03 Nov 2006 20:30:03 +0000 From: "Pedro Doria Meunier" To: Subject: help with a query Date: Fri, 3 Nov 2006 20:29:16 -0000 Message-ID: <004b01c6ff86$bc254ee0$23d6bed5@oem41cbbf9e178> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_004C_01C6FF86.BC254EE0" X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Thread-Index: Acb/hruYiQUlsBTITqOaS10FXsijQg== X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.156 tagged_above=0 required=5 tests=BAYES_50, HTML_FONT_FACE_BAD, HTML_MESSAGE, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200611/242 X-Sequence-Number: 103338 This is a multi-part message in MIME format. ------=_NextPart_000_004C_01C6FF86.BC254EE0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi all! This is most certainly a lame question but perhaps someone is gracious enough to lend me a hand. ;-) I have the following setup in a table: The first record which is to be found (ok easy enough :D) with a timestamp meets a certain condition (ignition off) The following record is for the event of ignition on again with a timestamp. So the question here is: how can I compute the time difference between these two records in a single query? Better yet: finding all the records that meet the first condition (ignition off) and the immediately following records as to compute the time difference. ;-) Thanks in advance! Pedro Doria Meunier (351) 91 302 49 72 - (351) 96 247 99 12 pdoria@netmadeira.com MSN - pdoriam@hotmail.com ICQ - 308-182-126 Skype: pdoriam ------=_NextPart_000_004C_01C6FF86.BC254EE0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi all!

 

This is most certainly a lame question but = perhaps someone is gracious enough to lend me a hand… = ;-)

 

I have the following setup in a = table:

 

The first record which is to be found (ok easy = enough :D) with a timestamp meets a certain condition (ignition = off)

The following record is for the event of = ignition on again with a timestamp.

 

So the question here is: how can I compute the = time difference between these two records in a single = query?

Better yet: finding all the records that meet = the first condition (ignition off) and the immediately following records as = to compute the time difference. ;-)

 

Thanks in = advance!

 

 

Pedro = Doria Meunier

(351) 91 302 49 72 - (351) 96 247 99 = 12

pdoria@netmadeira.com

MSN - pdoriam@hotmail.com=

ICQ - 308-182-126

Skype: pdoriam

 

------=_NextPart_000_004C_01C6FF86.BC254EE0--