Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 1BADC9FC113 for ; Fri, 13 Jul 2007 07:20:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 77073-05 for ; Fri, 13 Jul 2007 07:20:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.ringways.co.uk (unknown [80.193.83.130]) by postgresql.org (Postfix) with ESMTP id A78649FB39F for ; Fri, 13 Jul 2007 07:20:11 -0300 (ADT) Received: from eddie.ringways.co.uk ([10.1.1.115]) by mail.ringways.co.uk with esmtp (Exim 4.62) (envelope-from ) id 1I9I9n-0008Uj-Tu for pgsql-sql@postgresql.org; Fri, 13 Jul 2007 11:13:52 +0100 From: Gary Stainburn Organization: Ringways Garages Ltd To: pgsql-sql@postgresql.org Subject: Re: calculation of pay based on dates Date: Fri, 13 Jul 2007 11:16:44 +0100 User-Agent: KMail/1.9.5 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707131116.45147.gary.stainburn@ringways.co.uk> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/84 X-Sequence-Number: 28819 On Friday 13 July 2007 11:12, Penchalaiah P. wrote: > Hi ... > > I want to fix the pay based on joining date and antedate...antedate is > the last date... > > Joining date is 01-07-2007 > > Antedate is 04-07-2007.. > > > > On joining date I will fix the pay but before fixing the pay I will > check whether antedate is there or not, if its there then I will see > difference between 2 dates..if difference is 2 years then I will fix the > pay with increments...if difference is less than 2 years then I will fix > the pay with out increments... > > Take an example of above 2 dates..there is no 2 years difference between > two dates... > > 01-07-2007 I will fix the pay...after 3 days current date = > antedate...so again I have to fix the pay with out my intervention... > > Is there any jobs or schedules or triggers to call that function when > current date and antedate is equal... > > > > Any one can help on this... I need it very soon.... > > > Regards > Penchal > Surely this would easiest be done using a view rather than a trigger or function. Simply have the salary calculated every time the view is selected. -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000