On Friday 04 April 2008 15:01, Craig Ringer wrote: > Terry Lee Tucker wrote: > > Greetings: > > > > I am converting our application from 7.4.19 to 8.3.1. In the old scheme > > of things, I was generating an interval between two timestamps and > > evaluating the interval string in another set of trigger code. I was > > doing the following: > > IF new.ontime IS NOT NULL AND new.ontime ~* 'ago' THEN > > If I understand your question correctly, you're seeking to determine if > new.ontime is "in the past". If so, compare with current_timestamp / > current_date as appropriate, eg: > > IF new.ontime IS NOT NULL AND new.ontime < current_timestamp THEN > > (Note that current_timestamp and current_date are constant within a > transaction, so they might not be suitable if you have really long > running transactions). > > -- > Craig Ringer Craig, Thanks for the response. I have failed to communicate the problem. The ontime value is calculated based on the arrival time versus the appointment time; therefore the current timestamp is not helpful. I don't have the appointment data in this trigger and thus I can't do a comparison there unless I go find the appointment data, which I could do, but was trying to prevent the overhead. My question is: Is there a way to look directly at the timestamp value and determine if it was "ago", that is, negative? Thanks... -- Terry Lee Tucker Turbo's IT Manager Turbo, division of Ozburn-Hessey Logistics 2251 Jesse Jewell Pkwy NE Gainesville, GA 30501 Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 404-6987 terry@xxxxxxxxxxxxx www.turbocorp.com