Received: from redbox.venux.net (redbox.venux.net [216.47.238.10]) by hub.org (8.9.3/8.9.3) with ESMTP id UAA02729 for ; Tue, 18 May 1999 20:40:17 -0400 (EDT) (envelope-from matthew@venux.net) Received: from thunder (net177138.hcv.com [209.153.177.138]) by redbox.venux.net (Postfix) with SMTP for id 4AC6B2E20B; Tue, 18 May 1999 20:38:57 -0400 (EDT) Message-Id: <4.1.19990518203016.00ae1d00@mail.venux.net> X-Sender: mhagerty@mail.venux.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Tue, 18 May 1999 20:39:41 -0400 To: pgsql-interfaces@postgreSQL.org From: Matthew Hagerty Subject: Problems with money fields. Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Hello, I was wondering if someone could shed some light on money fileds for me. I am having a problem in that a money field plus a null money field equals null. Try this: create table test(total money); insert into test values(''); insert into test valuse(NULL); select * from test; total ----- $0.00 (2 rows) select '1'::money + total from test; ?column? -------- $1.00 (2 rows) Why is the second column blank? This is really throwing my calculations because there are times when $0.00 is different from no value at all. Also, how can I get a query of all rows where the money value is NULL? This fails: select * from test where total = NULL; ERROR: parser: parse error at or near "null" and this gives me the rows with $0.00: select * from test where total = ''; total ----- $0.00 (1 row) If I can't query for a money field with a NULL value, why can I insert one? Thank you, Matthew Hagerty