Subject Re: [ib-support] Count value on field
Author Martijn Tonies
NULL means the state of 'unknown'.

value + unknown = unknown

If you want your empty columns to behave as 0, better make sure they are 0.

If this behaviour is only wanted for the sake or summing the fields, try the
new Firebird User Defined Functions - see www.firebirdsql.org for more info
on those (release notes for FB1)

--
Martijn Tonies
Upscene Productions

InterBase Workbench - The Developer Tool for InterBase
http://www.interbaseworkbench.com

"Experience is what you get when you didn't get what you wanted"

""Bayu"" <bayu2000@ > schreef in bericht
news:001301c1d014$0e9edc60$2c6c053d@bayu01...
> Using FireBird 1.0.0 796 on Windows 98
>
> I have meta data like this
>
> CREATE DOMAIN NUMERIC_17_2 AS
> NUMERIC(17,2)
> /* can be fill with null values */
>
> CREATE TABLE TRANSAKSI (
> ID NUMERIC(18,0) NOT NULL,
> D_IMIP NUMERIC_17_2,
> D_SVIP NUMERIC_17_2,
> D_CDIP NUMERIC_17_2,
> JUMLAH_DEBET COMPUTED BY (D_IMIP+D_SVIP+D_CDIP));
>
> This table have two records with this value
>
> D_IMIP D_SVIP D_CDIP
> 1000.26 null null
> null 150.36 100.00
>
> What i want is the calculated field jumlah_debet will give 1000.26 result,
> but in this fields give me null results.
>
> I try statement like this
>
> select sum(d_imip)
> give me 1000.26 results
>
> select d_imip+d_svip+d_cdip from transaksi
> give me null results
>
> Any advice how to get results on this computed fields (remember that the
> fields d_imip,d_svip,d_cdip can
> fill with null values )
>
> Thanks for any comments.
>
> regards
>
> Bayu
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>