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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only