Bob --
Another approach is to use the LIKE operator in SELECT. You could put all the fields in the statement that you want the user to be able to select. The wildcard % selects all, so you can just assign that to parameters that the user has't chosen.
Date and numeric fields get a bit more complicated. I find that one additional logical field, e.g. lUseThisDate, works fine as follows:
WHERE
IIF (lUseThisDate, Table.dThisDate > ldThisDate, .T.) && if not using the date, includes the record.
I once built an ad-hoc query engine along the lines that you have. Working with parameterized views, I've found almost as much flexibility and probably greater speed.
Worth the tradeoff.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement