CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Label change problem

Print topic Send  topic

Author Message
cruisin

Posts: 31
Posted: 09/13/2007, 7:50 PM

I have a label problem that isn't specific to code charge, but I'm having trouble finding a reference to fix it. Basically I'm changing the label in a listbox (a +' '+ b + ' 'c) as d
which works fine as long as there aren't any null values. If any of the values are null then d is null. It should be possible for a, b, or c to be null but the result should still show the remaining combined value.
Any suggestions?
Thanks,
Rob
View profile  Send private message
Edd


Posts: 547
Posted: 09/15/2007, 6:17 PM

Assuming that you are using MSSQL then use the IsNull operator, example
  
(IsNull(a + ' ','') + IsNull(b + ' ', '') + IsNull(c,'')) as d  
You will note that I used
  
IsNull(a + ' ','')   
Instead of
  
IsNull(a,'') + ' '  

Becase if "a" is a null you don't want a space after it.

Hope it helps.
Edd

_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
Tuong Do
Posted: 10/09/2007, 5:23 PM

Hi Rob,

You can use the SQL coalesce function to return 0 if the value is null, for
example coalesce(a,0) will never return null

ie

Select coalesce(a,0) + coalesce(b,0) + coalesce(c,0) as d


"cruisin" <cruisin@forum.codecharge> wrote in message
news:646e9f6dbe4d80@news.codecharge.com...
>I have a label problem that isn't specific to code charge, but I'm having
> trouble finding a reference to fix it. Basically I'm changing the label
> in a
> listbox (a +' '+ b + ' 'c) as d
> which works fine as long as there aren't any null values. If any of the
> values
> are null then d is null. It should be possible for a, b, or c to be null
> but
> the result should still show the remaining combined value.
> Any suggestions?
> Thanks,
> Rob
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.