Re: calculations in forms vs queries?



Dear Howard:

My guess is that, for the sake of performance, it make so little difference
that is it not worth wondering about.

As a matter of style, the difference is also somewhat arbitrary. However,
query work is more difficult for most programmers, so keeping the length and
complexity of queries to a minimum is a positive advantage to most
programmers. So, for most, doing calculations in a control is preferable.

For those who are more advanced in query writing, the preferred solution
would probably be to put the calculations in the query. For me, it is nice
to arrange a query for a form or report so it shows the same columns, in the
same order, in final form for the finished product. Rather complex queries
written this way can run 2 or 3 printed pages in length. When I write such
a query, it is always for MSDE/SQL Server, and contains considerable
commenting, a feature that is not available in Jet queries.

So, I recommend you do what is most comfortable for you. If you work in an
environment where there are many programmers who may need to touch your code
later, I suggest you discuss this with the most senior programmers there,
and perhaps find a style most suited to everyone.

Tom Ellison


"Howard" <nospam@xxxxxxxxxxxxxxxxx> wrote in message
news:rP6dnXDRzokJ1eveRVnyvw@xxxxxxxxxxxx
>I have a number of calculations that build on each other , originally based
> on some fields and I need the interim results as well as the final one. I
> also at one point use a function that I wrote myself and is held in a
> module. Now, I can do all these calcs in a control on a form or I can do
> it
> in the forms query and just present the values I want to the form.
>
> Which is the best way and why?
>
> Also, is it 'better' to write a query and use that as the source for a
> form
> or report or is it better to build the query directly in the form or
> report's data source property?
> (I must admit in assess 2003 I do the former as trying to execute sql in a
> control's data source usually crashes access 2003 - not so 2000)
>
> Howard
>
>


.



Relevant Pages

  • Re: expression not working???
    ... i already have many queries. ... >>be broken (complex calculations which greatly impact ... >>updating the table directly (via form or query views) ... >>Sandra Daigle ...
    (microsoft.public.access.forms)
  • RE: Help with creative thinking needed
    ... designated stock items and have a field of # of Days to Stock. ... query to get sales info for each stock ... totals was considerably faster than using separate queries, ... Are there other ways of shaving milliseconds from calculations and queries, ...
    (microsoft.public.access.modulesdaovba)
  • RE: Help with creative thinking needed
    ... designated stock items and have a field of # of Days to Stock. ... totals was considerably faster than using separate queries, ... query or a single joined query between sales and parts tables. ... Are there other ways of shaving milliseconds from calculations and queries, ...
    (microsoft.public.access.modulesdaovba)
  • Microsoft Cleanliness
    ... I guess I've been working with A97 too long. ... In the database window they added a couple of wizards to clutter it up instead of. ... MS preceeds each table with the word TABLE and each query with "QUERY". ... I guess MS programmers have never heard a dropdown can have more than one column. ...
    (comp.databases.ms-access)
  • Re: Using calculated fields in multiple queries
    ... the non-calculated fields also get locked in the queries. ... But the calculations behind the calculated fields are ... >> the basic Table and the Basic Query, and I added the fields Calculated1, ...
    (microsoft.public.access.queries)