[AccessD] Why doesn't this work?

Arthur Fuller fuller.artful at gmail.com
Sun Jul 22 13:07:06 CDT 2007


Just a wag, but that query makes no sense to me. This could be the absence
of information, of course, but what you wrote appears non-logical. Maybe you
mis-typed, but given what you supplied and breaking it down, I end up with
this:

IIf(
    ServOption()=0,
    >1,
    ServOption()
)

Perhaps that was one accidental keystroke (the ">") -- that's the part that
makes no sense IMO.

If ServOption() is a static function, then something like this might
possibly work:

(Assume ServOption() currently returns either zero or three, just to choose
some value)

SELECT * FROM mytables
WHERE ServeOption() = 0
OR <whatever serveoption refers to> = ServeOption()

Only one of these ORs can exist so I think that covers the bases. I could be
more specific if I knew exactly what criteria ServeOption() was testing, but
that's the general idea.

hth,
Arthur

On 7/22/07, Robert <robert at servicexp.com> wrote:
>
>
> IIf(ServOption()=0,>1,ServOption())
>
> This is the criteria in a query.
>
> ServOption is a function that returns a long. The query works when
> ServOption returns a specific option. However if ServOption returns 0, all
> the records are to be displayed, but doesn't
>
>
>
>
> WBR
> Robert
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



More information about the AccessD mailing list