Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 92F1A9FA0A3 for ; Wed, 3 Oct 2007 14:07:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 93493-05 for ; Wed, 3 Oct 2007 14:07:23 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web31808.mail.mud.yahoo.com (web31808.mail.mud.yahoo.com [68.142.207.71]) by postgresql.org (Postfix) with SMTP id F1E599F95CB for ; Wed, 3 Oct 2007 14:07:28 -0300 (ADT) Received: (qmail 3162 invoked by uid 60001); 3 Oct 2007 17:07:26 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=1sU9zEQdihDxHsgrgDb77XppQtMzDe4hstZj7urltlAS0/lZ7Q77WLCYI0jhRTVX2qDpizwmKn3E4PUDmK+SmY+va9emG9dSToycYL3E+qS2cboW0XCtzHscErP0UrhC9gw4UflmIkTx37NJqmXuMIxtopWj5B1jmu2sdUDJeY4=; X-YMail-OSG: 1VjXSuMVM1lv2yXAmuWiuN5Wai_tTLUU52vb3bNmDPj9s1eOINtk6U4dEIeeJ1hQXlaq5UJN.w-- Received: from [12.180.237.138] by web31808.mail.mud.yahoo.com via HTTP; Wed, 03 Oct 2007 10:07:25 PDT Date: Wed, 3 Oct 2007 10:07:25 -0700 (PDT) From: Richard Broersma Jr Subject: Re: Need help with CASE statement in Function To: Hengky Lie , pgsql-sql@postgresql.org In-Reply-To: <000d01c805dc$9e8db450$1d00a8c0@hengky> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <282657.3138.qm@web31808.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/15 X-Sequence-Number: 29387 --- Hengky Lie wrote: > My Question is : How to make argument 4 optional ? When IS NULL the function > will show all transaction between date $1 and $2 and product ID=$3 Could you simply overload your function by having two functions? One with arguement 4 and one without? Regards, Richard Broersma Jr.