Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Summary with NULL
I get no result when I add these variables.
{@SharedBonnen} + {@SharedContract} + {@SharedImproductief} +
{@SharedProject} + {@SharedRelatie}

(VB.Net 2003 with CR.)

The problem is caused by NULL values.
I read in this newsgroup something about If Is NULL then...
but I couldn't get it working.

Can anybody tell me how to do this?

Kind regards,
Alison.





Report this thread to moderator Post Follow-up to this message
Old Post
Alison Givens
01-31-06 12:05 AM


Re: Summary with NULL
You will want to use the "IsNull" keyword (note that this is one word).
For instance:

Dim Value As Number

If Not IsNull({@SharedBonnen}) then
Value = Value + {@SharedBonnen}
End If

If Not IsNull({@SharedContract}) then
Value = Value + {@SharedContract}
End If

...etc.

Jay Taplin [MCP - VB]


Report this thread to moderator Post Follow-up to this message
Old Post
Jay Taplin
01-31-06 12:05 AM


RE: Summary with NULL
Alison, If you follow the my posting carefully, that you referenced, it
should work fine as follows:

If IsNull({Field1}) Then
{Field2}+{Field3}+{Field4}+{Field5}
Else If IsNull({Field}) Then
{Field1}+{Field3}+{Field4}+{Field5}
Else If IsNull({HATB.BUKT3}) Then
{Field1}+{Field2}+{Field4}+{Field5}
Else If IsNull({Field}) Then
{Field1}+{Field2}+{Field3}+{Field5}
Else
 {Field1}+{Field2}+{Field3}+{Field4}+{Fie
ld5}
"Alison Givens" wrote:

> I get no result when I add these variables.
> {@SharedBonnen} + {@SharedContract} + {@SharedImproductief} +
> {@SharedProject} + {@SharedRelatie}
>
> (VB.Net 2003 with CR.)
>
> The problem is caused by NULL values.
> I read in this newsgroup something about If Is NULL then...
> but I couldn't get it working.
>
> Can anybody tell me how to do this?
>
> Kind regards,
> Alison.
>
>
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Shariq
01-31-06 12:05 AM


Re: Summary with NULL
Unfortunately, that solution will not work for a couple of reasons.  1)
In your Else If IsNull(xxx) lines, the "xxx" does not have the valid
field names.  2) If you have more than one field that has nulls, the
formula will still error out (ex. Field1 and Field2 are NULL).

I'd do them all separately, as in my post.


Report this thread to moderator Post Follow-up to this message
Old Post
Jay Taplin
01-31-06 12:05 AM


Re: Summary with NULL
Thanks guys,
I enhanced the formula to this and it works:

If IsNull ({@SharedReisCorrect}) then 0 else {@SharedReisCorrect} + If
IsNull ({@SharedReisDubbel}) then 0 else {@SharedReisDubbel} + If IsNull
({@SharedReisFoutief}) then 0 else {@SharedReisFoutief}

Alison.



"Jay Taplin" <jaytaplin@integraware.com> wrote in message
news:1138651268.612627.144020@o13g2000cwo.googlegroups.com...
> Unfortunately, that solution will not work for a couple of reasons.  1)
> In your Else If IsNull(xxx) lines, the "xxx" does not have the valid
> field names.  2) If you have more than one field that has nulls, the
> formula will still error out (ex. Field1 and Field2 are NULL).
>
> I'd do them all separately, as in my post.
>



Report this thread to moderator Post Follow-up to this message
Old Post
Alison Givens
01-31-06 09:11 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic Crystal Reports archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:17 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.