
Originally Posted by
rpeare
You can't have an if/then in your query if it's an actual database object. You'd basically have to open the query modify the SQL statement, save the query then re-open the query (if you were doing it with code).
If you're willing to see blank fields where the D table would be that's a different matter and you can do it in your query.
if However you're creating a dynamic dataset in some VB script you can certainly modify the SQL statement to properly create a set of data.