>lcWhere = ''
>FOR i=1 TO ALEN(laFilter)
> IF i = 1
> lcWhere = ALLT(laFilter[i])
> ELSE
> IF ! EMPTY(laFilter[i])
> lcWhere = lcWhere + ' AND ' + ALLT(laFilter[i])
> ENDIF
> ENDIF
>NEXT i
>
>Wouldn't something like that work? Obviously you could get more elaborate.
>
>Wayne
My preferred way of dealing with things like this:
lcWhere = ''
lcAnd=""
FOR i=1 TO ALEN(laFilter)
IF ! EMPTY(laFilter[i])
lcWhere = lcWhere + lcAnd + ALLT(laFilter[i])
lcAnd=" and "
ENDIF
NEXT i
Not doing much, just for shorter code and one less nested IF.