Lynn,
PMFJI, but I've been trying to wrap my mind around this one for a few minutes now and I'm not sure I'm completely clear on what you're really after. I've tried to re-create your example on some sample data I have, but your example is incomplete, so I'm having to guess at a few things.
I believe Mac's on idea regarding the inclusion operator may help, but I don't think you'll be happy the resulting performance hit, for outer joins are far more time consuming than simple matches.
Depending on what you're really trying to accomplish, I think I'd be tempted to run a series of queries instead of trying to put everything into a single query.
Also, I'm rather surprised your query is faster than your TCursor-based approach, as I've frequently seen the reverse behavior.
Finally, you can include IIF in a query, but only as part of a
query expression, which Paradox parses while defining the query. Here's an example:
Code:
q = Query
:DATA:ORDERS | Ship Date |
Check | > today(), < today + ~( iif( dow() = 1, "8", iif( dow() = 7, "9", "7" ) ) ) |
Endquery
Now, I realize that may be a bit hard to read, but the idea is to let Paradox determine the day of the week and then to return the orders that need to be shipped by the same business day next week. (OK, that's a bit confusing, but if the query is run on Saturday or Sunday, then we return the following Monday.)
The thing to remember about query expressions, though, is that you must return values that can be coerced into string values, as that's how QBE grammer is parsed by ObjectPAL.
Hope this helps...
-- Lance