Help for writing a query !

carvind

Registered User.
Local time
Today, 04:17
Joined
Nov 10, 2000
Messages
22
I have a table with multiple fields and each record in the table may not have data for all fields. I need to write a query that will pull only the fields that are populated for each record from the table. Any help you provide would be appreciated. Thanks
 
Not only can't you do that, its making alarm bells go off that indicate your table is improperly structured.

In a query, you must define which fields show--and then they show for all records. THink of a query as a dynamic generated spreadsheet. You can make column A show, but its going to show for every record, you can't show column A for rows 1-5, but then hide it for row 6, show it for rows 7 and on. Either the column shows or it doesn't.

Like I said though, asking that question is an indiciation of larger problems. While you can think of a query as a dynamic spreadsheet, you can't think of tables like that. Tables need to be structured properly, that process is called normalization (http://en.wikipedia.org/wiki/Database_normalization). I'm not certain you've done that.

Can you post sample data from your table and then what you would like this query to return? Again, demonstrate what you want with data--show starting sample data from your table (include table and field names) and then show what data should be returned from the query you hope to write.
 

Users who are viewing this thread

Back
Top Bottom