Use only Orimary Keys in Query or include fields wanted in report as well?

Cosmos75

Registered User.
Local time
Today, 02:24
Joined
Apr 22, 2002
Messages
1,280
Use only primary Keys in Query or include fields wanted in report as well?

I have queries that join back data in a relational database and performs calculations. There is a report that summarizes this data and calculations.

The question I have is should I be including all the fields I want to show on the report in the query or only the primary-keys for the tables in my query with my calculations, and then add the primary keys from the query and pull the other data from the tables themselves? Which way is more efficient and less taxing on a computer's resources?

:confused:

Edit: I tried to edit the typo in the topic but it only corrected what you see here and not the topic title on the main page?
 
Last edited:
In most cases the most efficient is to gather all the info you need in your queries , and avoid calculations in queries (in particular the ones using functions, have the calculations done in your reports as far as possible)
 
Often need more than one query - Last calculation in report and NOT in query?

Thanks for your reply :D

What kind of calculations would be appropriate for query? More often than not, I am forced to perform more than one query to get to the calculated value that I desire. Would that be a case where I need to use a query to perform all the final calculations and just perform the last calculation I want in the report?:confused:
 

Users who are viewing this thread

Back
Top Bottom