View Full Version : Query Query


Old Gnome
08-17-2001, 07:45 AM
I have a query that contains nearly 200 fields. I have used naming conventions to name the fields -- most of them are as a result of performing using the result of a function against a value in the source table, the few others are just brought over from the single source table.

I started developing the query in the order in which the data will appear on a report, as I thought that would be easier to find the fields when creating the report. That worked, but I have rethought the report (the 22 inch maximum length of a report is too short). I have broken the report up into its component pages.

Questions:
1. Should I also break my query into its component parts, matching the report pages?
2. Is there any way to 'sort' the query fields, so they appear in alpha-numeric order? This would ease splitting the query.

TIA

oldgnome

Jack Cowley
08-17-2001, 10:05 AM
Since your query is done and working why not just let the report be two pages long? You can put the data in any order on the report that you like and use a Page Break to break it at a specific place if you like. If you want two separate reports then use the same query for each on and only put the appropriate fields in each report.

Rich
08-17-2001, 11:40 AM
200 fields?

Old Gnome
08-17-2001, 02:49 PM
The problem with only one report is that all of the information didn't fit within the confines of an Access report.

Yes, 200 fields. It is a cost modeling program for IS projects.

oldgnome

Jack Cowley
08-17-2001, 05:14 PM
Gotcha! I blew that one big time! Then two reports it is, printed one after the other so it looks like one report.. At least I hope that will work for you...

Old Gnome
08-17-2001, 05:34 PM
Right. So, back to my original questions:

Split the query?

Any way to automatically sort (even with export/import) the query's resulting field names?

TIA

oldgnome

Jack Cowley
08-17-2001, 06:11 PM
You can split the query. You can make a copy then delete half of the fields from each copy and base your report(s) on each query. Now that I think about that it may not be too difficult to do that and it will tend to keep things in order. I am sorry to say that I cannot think of a way to sort your query by the fields in the query. That is really the tough part too as it would make your job easier....

[This message has been edited by Jack Cowley (edited 08-17-2001).]

Old Gnome
08-18-2001, 01:49 PM
Does the order in which the SQL code appears have anything to do with the order in which the fields appear in the field selection box in reports?

If so, I could take the SQL code and sort that. A bit tedious, but I think that's a lot easier than trying to drag the fields around in Query Design Mode.

oldgnome

Jack Cowley
08-18-2001, 02:13 PM
The order in the Field List is order that the items are in the query or SQL statement. Moving the fields in the SQL to the order you want will be reflected in your Field List.

Old Gnome
08-18-2001, 03:14 PM
Jack:

Thanks! Now I know how to go about it.

oldgnome