[thelist] Other ways to check for null
Casey
aspnet at thecrookstons.com
Mon Nov 14 15:20:45 CST 2005
Nice catch indeed. Thanks Mark.
> The logic is wrong here.
>
> You're basically saying (pseudocode):
>
> if rs("num_bedrooms") is not null or "" then...
>
> It can't be both those things, so it's always going to evaluate as true
> i.e.
> if it's null, then it's not ""
>
> You should be able to get away with a check for a zero length string to
> make
> it simple.
>
> But really, the question should be, why is num_bedrooms not an integer,
> and
> so why aren't you checking to see if it is >0?
>
> Hope this helps
>
> Mark
More information about the thelist
mailing list