Skip site navigation (1) Skip section navigation (2)

Re: How to Substract Milliseconds from A timestamp(3) Field

From: "Brandon Aiken" <BAiken(at)winemantech(dot)com>
To: "Lane Van Ingen" <lvaningen(at)esncc(dot)com>,<pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to Substract Milliseconds from A timestamp(3) Field
Date: 2006-10-17 21:03:11
Message-ID: F8E84F0F56445B4CB39E019EF67DACBA3415D8@exchsrvr.winemantech.com (view raw or flat)
Thread:
Lists: pgsql-novice
SELECT (end_time - interval '00:00:05') AS work_timestamp FROM mytable;

--
Brandon Aiken
CS/IT Systems Engineer

-----Original Message-----
From: pgsql-novice-owner(at)postgresql(dot)org
[mailto:pgsql-novice-owner(at)postgresql(dot)org] On Behalf Of Lane Van Ingen
Sent: Tuesday, October 17, 2006 2:33 PM
To: pgsql-novice(at)postgresql(dot)org
Subject: [NOVICE] How to Substract Milliseconds from A timestamp(3)
Field

In PLPGSQL, does anyone know how to subtract MILLISECONDS from a field
defined as timestamp(3), yielding another field defined as timestamp(3)?

Have been trying interval, and conversion functions but no luck.

Example: '2006-10-17 14:23:28.951'; subtract 5 milliseconds from a field

   called mytable.end_time, and return the results to a field named
   work_timestamp.

work_timestamp := ????



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

In response to

Responses

pgsql-novice by date

Next:From: Steve CrawfordDate: 2006-10-17 21:14:20
Subject: Re: How to Substract Milliseconds from A timestamp(3) Field
Previous:From: Lane Van IngenDate: 2006-10-17 18:33:16
Subject: How to Substract Milliseconds from A timestamp(3) Field

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group