all or some records

  • Thread starter Thread starter JeffMKlein
  • Start date Start date
J

JeffMKlein

My query uses a function (fclinetID) in the clientID criteria. Sometimes I
want to run this query for all clientID records (not null records). Is
there a way to use someting like the following code.

IIf(IsNull(fclientid()),"ALL RECORDS" ,fclientid())

I know "ALL RECORDS" is not real but I need something that acts like it.
 
Guessing here, but you might be able to use the following.

IIf(IsNull(fclientid()),[ClientID],fclientid())

Basically, this should return all records where the ClientID is equal to
itself, if fClientID() returns a null value. Since NULL is never equal to
anything (including another null), any record where ClientID is null won't
be returned.
 
John, Thanks for the reply. This works!! Cant believe I did not think of
it. Sometimes simple is too obvious


John Spencer said:
Guessing here, but you might be able to use the following.

IIf(IsNull(fclientid()),[ClientID],fclientid())

Basically, this should return all records where the ClientID is equal to
itself, if fClientID() returns a null value. Since NULL is never equal to
anything (including another null), any record where ClientID is null won't
be returned.

JeffMKlein said:
My query uses a function (fclinetID) in the clientID criteria. Sometimes
I
want to run this query for all clientID records (not null records). Is
there a way to use someting like the following code.

IIf(IsNull(fclientid()),"ALL RECORDS" ,fclientid())

I know "ALL RECORDS" is not real but I need something that acts like it.
 
Back
Top