Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Zeros and Nulls

4 posts in DataWindow Last posting was on 2008-09-25 22:01:15.0Z
Ken Breneman Posted on 2008-09-24 21:29:19.0Z
Sender: 4fb.48daadbf.1804289383@sybase.com
From: Ken Breneman
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Zeros and Nulls
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48dab12f.5b4.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 24 Sep 2008 14:29:19 -0700
X-Trace: forums-1-dub 1222291759 10.22.241.41 (24 Sep 2008 14:29:19 -0700)
X-Original-Trace: 24 Sep 2008 14:29:19 -0700, 10.22.241.41
Lines: 14
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87840
Article PK: 417094

Forgive me if this is a dumb question -- but I've never been
able to work out a best practice for the following:

How do you have a DW that includes, for example, a currency
column, and you want the values 0 (i.e. zero dollars) and
null (i.e. no response or no data) to be two distinct
values? Zero and null should be displayed differently so
the user can tell them apart and users should be able to SET
the column to either zero or to null.

Is there a way to do this using display and/or edit formats?
My usual result is the user losing their ability to null an
existing value (it always gets set to zero), and zero and
null both being displayed the same (as zero).


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-09-24 21:44:09.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <48dab12f.5b4.1681692777@sybase.com>
Subject: Re: Zeros and Nulls
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48dab4a9@forums-1-dub>
Date: 24 Sep 2008 14:44:09 -0700
X-Trace: forums-1-dub 1222292649 10.22.241.152 (24 Sep 2008 14:44:09 -0700)
X-Original-Trace: 24 Sep 2008 14:44:09 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87841
Article PK: 417096

From chapter 22 of the User's Guide
A number display format can have up to four sections. Only the first is
required. The three other sections determine how the data displays if its
value is negative, zero, or NULL. The sections are separated by semi-colons:


Positive-format;negative-format;zero-format;null-formatYou would not be able
to use an editmask style, as it does not have the NilIsNull [empty string is

null] property.<Ken Breneman> wrote in message
news:48dab12f.5b4.1681692777@sybase.com...
> Forgive me if this is a dumb question -- but I've never been
> able to work out a best practice for the following:
>
> How do you have a DW that includes, for example, a currency
> column, and you want the values 0 (i.e. zero dollars) and
> null (i.e. no response or no data) to be two distinct
> values? Zero and null should be displayed differently so
> the user can tell them apart and users should be able to SET
> the column to either zero or to null.
>
> Is there a way to do this using display and/or edit formats?
> My usual result is the user losing their ability to null an
> existing value (it always gets set to zero), and zero and
> null both being displayed the same (as zero).


Paul Horan[Sybase] Posted on 2008-09-24 22:03:42.0Z
From: "Paul Horan[Sybase]" <phoran_nospam@sybase.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <48dab12f.5b4.1681692777@sybase.com>
Subject: Re: Zeros and Nulls
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48dab93e$1@forums-1-dub>
Date: 24 Sep 2008 15:03:42 -0700
X-Trace: forums-1-dub 1222293822 10.22.241.152 (24 Sep 2008 15:03:42 -0700)
X-Original-Trace: 24 Sep 2008 15:03:42 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87842
Article PK: 417097

Numeric number formats have four sections, separated by semi-colons:
Positive-format;negative-format;zero-format;null-format

So something like this would work:
$#,##0.00;[RED]($#,##0.00);-0-;{NULL}

Make sure you have the "Empty String is NULL" checkbox turned on as well in
the Edit properties of the column.

Paul Horan[Sybase]

<Ken Breneman> wrote in message news:48dab12f.5b4.1681692777@sybase.com...
> Forgive me if this is a dumb question -- but I've never been
> able to work out a best practice for the following:
>
> How do you have a DW that includes, for example, a currency
> column, and you want the values 0 (i.e. zero dollars) and
> null (i.e. no response or no data) to be two distinct
> values? Zero and null should be displayed differently so
> the user can tell them apart and users should be able to SET
> the column to either zero or to null.
>
> Is there a way to do this using display and/or edit formats?
> My usual result is the user losing their ability to null an
> existing value (it always gets set to zero), and zero and
> null both being displayed the same (as zero).


Ken Breneman Posted on 2008-09-25 22:01:15.0Z
Sender: 4fb.48daadbf.1804289383@sybase.com
From: Ken Breneman
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Zeros and Nulls
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48dc0a2b.39a9.1681692777@sybase.com>
References: <48dab93e$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 25 Sep 2008 15:01:15 -0700
X-Trace: forums-1-dub 1222380075 10.22.241.41 (25 Sep 2008 15:01:15 -0700)
X-Original-Trace: 25 Sep 2008 15:01:15 -0700, 10.22.241.41
Lines: 51
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87857
Article PK: 417115

Yes! Thank you Paul and Jerry! This works very nicely.

The format I think I've decided on is this:
#,##0.00;[RED](#,##0.00);0.00;
where there is a space character at the end. This makes a
zero look like a zero and a null look like an empty field --
which is perfect. :-)

This is unrelated to my original question but the reason I
am not including dollar signs is because our app is used
internationally. I guess the format I would REALLY like to
use is this:
[currency];[currency];[currency];
again with the space at the end. Unfortunately this did not
work the way I expected it to. Dollar signs are still added
to the field regardless of the regional settings selected in
Windows.

Thanks again for the help!
Ken

> Numeric number formats have four sections, separated by
> semi-colons: Positive-format;negative-format;zero-format
> ;null-format
>
> So something like this would work:
> $#,##0.00;[RED]($#,##0.00);-0-;{NULL}
>
> Make sure you have the "Empty String is NULL" checkbox
> turned on as well in the Edit properties of the column.
>
> Paul Horan[Sybase]
>
> <Ken Breneman> wrote in message
> > news:48dab12f.5b4.1681692777@sybase.com... Forgive me if
> > this is a dumb question -- but I've never been able to
> work out a best practice for the following: >
> > How do you have a DW that includes, for example, a
> > currency column, and you want the values 0 (i.e. zero
> > dollars) and null (i.e. no response or no data) to be
> > two distinct values? Zero and null should be displayed
> > differently so the user can tell them apart and users
> > should be able to SET the column to either zero or to
> null. >
> > Is there a way to do this using display and/or edit
> > formats? My usual result is the user losing their
> > ability to null an existing value (it always gets set to
> > zero), and zero and null both being displayed the same
> (as zero).
>
>