Re: Setting expire date on insert/modify
| От | Stephan Szabo |
|---|---|
| Тема | Re: Setting expire date on insert/modify |
| Дата | |
| Msg-id | 20060124171515.U43544@megazone.bigpanda.com обсуждение исходный текст |
| Ответ на | Setting expire date on insert/modify ("Foster, Stephen" <stephenlfoster@comcast.net>) |
| Ответы |
Re: Setting expire date on insert/modify
|
| Список | pgsql-general |
On Tue, 24 Jan 2006, Foster, Stephen wrote: > CREATE OR REPLACE FUNCTION "TF_BannerAd_Ads_InsMod"() > RETURNS "trigger" AS > $BODY$ > DECLARE > ExpireDate timestamptz; -- Date the Banner Ad will expire. > StartDate char(10); -- Date the Banner Ad was created or > renewed > NumOfDays char(10); -- Number of Dates the Ad will be in > place. > BEGIN > StartDate := to_char(NEW.bannerad_creationdate, 'YYYY-MM-DD'); > NumOfDays := to_char(NEW.bannerad_term, '99999'); > ExpireDate := (date 'StartDate' + integer 'NumOfDays'); I think something like: ExpireDate := CAST(NEW.bannerad_creationdate as Date) + NEW.bannerad_term; may work for you.
В списке pgsql-general по дате отправления: