Subject NULLS in VIEW when adding values
Author Erik De Laet
Hi,

In a view like:

select Nr1, Nr2, Nr1 + Nr2 as NrTotal from ATable

I want to add only the numbers Nr1 and Nr2 if
they are not null and >= 0, is this possible ?

Something like:

select Nr1, Nr2,
if (Nr1 not is null) and (Nr1 >= 0) then Nr1 else 0 +
if( (Nr2 not is null) and (Nr2 >= 0) then Nr2 else 0
as NrTotal from ATable

If it is not possible in a view, is it possible in a stored procedure ?

Any help would be higly appreciated,

Thanks,
Erik



----------
Erik De Laet - CEO E.De.L.Com bvba
Author of Sitestepper - the Web Maintenance
program. Visit the home of Sitestepper at www.sitestepper.com.
Programmer by choice and profession !

----------
E.De.L.Com bvba - The Software bridge to the user !
Software-, hardware en internetconsultants and
developers in Delphi, Paradox and VBA (Word, Excel en Access).

----------
Lambrechtshoekenlaan 211-2170 Merksem
(Antwerpen)-Belgiƫ-ONr:BTW BE 0460.974.682
tel: (32)3-541 77 24 - fax: (32)3-542 49 69 -
mobile: (32)475-32 99 47 - (32)475-81 67 83
web site: www.edelcom.be - www.edelcom.com - email: info@...


[Non-text portions of this message have been removed]