Re: ADOrs "Invalid Use of Null"



totcoll_by_speci = IIf(IsNull(!TotCollectedBySpecie), 0,
!TotCollectedBySpecie)

Yeah, that will work, but others here have pointed out that the IIF
construct is not known for its efficiency. If you are going to do it
using IsNull and the IIF, it is faster if you eliminate the IIF and
use a simple IF statement instead.

Heresy! <mumble><mumble>can you imagine?<mumble><mumble>counseling someone
to not use a one-liner<mumble><mumble>

<g>

I'm not a database person myself; but since totcoll_by_speci is declared as
a Long, can't you just add zero to the !TotCollectedBySpecie term and avoid
the Null problem?

totcoll_by_speci = 0 + !TotCollectedBySpecie

Rick


.


Loading