Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit query fields to those which have data

Status
Not open for further replies.

simon1974

Technical User
Apr 2, 2002
43
US
Is there a way to limit the query fields returned to only those which have data? Specifically, I am running a Top 25 query on another query (cross tab in this case). The Top 25 query returns all of the fields that are contained in the cross tab, even though many of them don't contain values in the top 25 records. I'd like it to only return those fields which have values in the top 25. As information, I am using * as my field value pulling from the crosstab because the field output from the crosstab is dynamic. Any help would be appreciated.
 
May be a bit length but you could "make" a table from a sorted query (top 25) and if you need to repeat this; use a delete query and wrap this process into a macro.
 
I was contemplating that process, but I wasn't sure how to do a maketable and limit the fields if I didn't know what fields were going to show up all null. Depending on the selection criteria, the underlying data (which changes month to month), I'm would be sure which fields were going to be null. Is there a way to tell the maketable query to only create columns for which values exist, or is there a way to structure a delete query to delete a column (but not a record) in a table based on the entire column being null. I know, its tough. You're response is appreciated, let me know if you think of anything else.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top