X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id CF494D1B4E3 for ; Fri, 17 Oct 2003 04:57:04 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 63322-07 for ; Fri, 17 Oct 2003 01:56:34 -0300 (ADT) Received: from smtp-1.indo.net.id (smtp-1.indo.net.id [202.159.32.91]) by svr1.postgresql.org (Postfix) with SMTP id 38A8ED1B4E6 for ; Fri, 17 Oct 2003 01:56:30 -0300 (ADT) Received: (qmail 8009 invoked from network); 17 Oct 2003 11:56:24 +0700 Received: from smtp.indo.net.id (202.159.32.81) by smtp-1.indo.net.id with SMTP; 17 Oct 2003 11:56:24 +0700 Received: (qmail 7848 invoked from network); 17 Oct 2003 04:53:59 -0000 Received: from unknown (HELO pop.makassar.indo.net.id) (202.159.23.19) by smtp.indo.net.id with SMTP; 17 Oct 2003 04:53:59 -0000 Received: FROM middinkcomp BY pop.makassar.indo.net.id ; Fri Oct 17 13:05:20 2003 +0700 Message-ID: <000001c3946c$86ff1a30$1f00a8c0@middinkcomp> From: "Muhyiddin A.M Hayat" To: "Steve Crawford" Cc: References: <002e01c39356$d5885ca0$1f00a8c0@middinkcomp> <200310151331.22516.scrawford@pinpointresearch.com> <001101c3940c$29f004e0$1f00a8c0@middinkcomp> <200310161035.35762.scrawford@pinpointresearch.com> Subject: Re: Calc Date: Fri, 17 Oct 2003 09:38:05 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/201 X-Sequence-Number: 15601 > > trx_date | trx_time | descriptions | > > payment_method | debet | credit | creator > > ------------+----------+--------------------------------------+---- > >--------- ---+-------+----------+--------- > > 2003-10-09 | 21:55:02 | Resto Biling : 13,800, Paid : 10,000 | > > Visa > > > > | 3800 | | middink > > > > 2003-10-16 | 03:28:30 | Payment - Thank You | > > Visa > > > > | | 40000.00 | middink > > > > 2003-10-08 | 18:17:40 | Payment - Thank You | > > Cash > > > > | | 50000.00 > > The id field only keeps the transactions in the correct order so you > can sum the previous transactions. You can do the same thing with > your date and time fields (though using a single datetime field would > be easier). A caution, though: you will have trouble if two > transactions share the same date and time. if i would like to pleaced ID(Virtual ID) for example number of record for each record, how to ? num_rec | trx_date | trx_time | credit | descriptions | payment_method | debet ---------+------------+----------+----------+------------------------------- -------------------------+----------------+------- 1 | 2003-10-09 | 21:55:02 | | Resto Biling : Rp. 13,800, Paid : Rp. 10,000 | Visa | 3800 2 | 2003-10-16 | 03:28:30 | 40000.00 | Payment | Visa | 3 | 2003-10-08 | 18:17:40 | 50000.00 | Payment | Cash |