PC Review


Reply
Thread Tools Rate Thread

Avoid Sumof, Avgof etc in new table

 
 
David
Guest
Posts: n/a
 
      2nd Feb 2009
When creating a table from a make table query- always get the sumof as part
of the new column heading- other than by changing the name of the column in
the first query- can I stop access changing the column name? i.e leave out
the "sumof" but still do the calculation?
--
Thanks for your help
 
Reply With Quote
 
 
 
 
Dale Fye
Guest
Posts: n/a
 
      2nd Feb 2009
Not that I'm aware of.

The only way I am aware of is to change the alias of the column in the query.

SELECT GroupID, Sum(yourTable.[SomeField]) as FieldAlias
FROM yourTable

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



"David" wrote:

> When creating a table from a make table query- always get the sumof as part
> of the new column heading- other than by changing the name of the column in
> the first query- can I stop access changing the column name? i.e leave out
> the "sumof" but still do the calculation?
> --
> Thanks for your help

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      2nd Feb 2009
On Mon, 2 Feb 2009 08:07:02 -0800, David <(E-Mail Removed)>
wrote:

>When creating a table from a make table query- always get the sumof as part
>of the new column heading- other than by changing the name of the column in
>the first query- can I stop access changing the column name? i.e leave out
>the "sumof" but still do the calculation?


I'd question whether *either* a MakeTable query OR storing calculated data is
appropriate in any case!

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it as a
calculated field in a Query; you can base reports, forms, etc. on that query.
--

John W. Vinson [MVP]
 
Reply With Quote
 
Dale Fye
Guest
Posts: n/a
 
      2nd Feb 2009
John,

Although I generally agree, there are times when creating the temporary
table, or creating a table to store aggregate data is appropriate.

I worked on an application not to long ago that had a number of reports that
were each based on the same aggregate query (actually this was a series of
queries). This query took several minutes to run, but since the users were
only concerned with the information as of the close of the previous business
day, I was able to significantly improve the time it took the users to
generate these reports by populating an aggregate table first thing each
morning.

--
Dale

email address is invalid
Please reply to newsgroup only.



"John W. Vinson" wrote:

> On Mon, 2 Feb 2009 08:07:02 -0800, David <(E-Mail Removed)>
> wrote:
>
> >When creating a table from a make table query- always get the sumof as part
> >of the new column heading- other than by changing the name of the column in
> >the first query- can I stop access changing the column name? i.e leave out
> >the "sumof" but still do the calculation?

>
> I'd question whether *either* a MakeTable query OR storing calculated data is
> appropriate in any case!
>
> Storing derived data such as this in your table accomplishes
> three things: it wastes disk space; it wastes time (almost
> any calculation will be MUCH faster than a disk fetch); and
> most importantly, it risks data corruption. If one of the
> underlying fields is subsequently edited, you will have data
> in your table WHICH IS WRONG, and no automatic way to detect
> that fact.
>
> Just redo the calculation whenever you need it as a
> calculated field in a Query; you can base reports, forms, etc. on that query.
> --
>
> John W. Vinson [MVP]
>

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      2nd Feb 2009
On Mon, 2 Feb 2009 10:35:01 -0800, Dale Fye <(E-Mail Removed)> wrote:

>John,
>
>Although I generally agree, there are times when creating the temporary
>table, or creating a table to store aggregate data is appropriate.


Oh, I agree... it *can* be necessary. I tend to scream, kick and struggle as
I'm being dragged to the keyboard to do so (or at least require a
*demonstrated*, not assumed, good reason to violate the principle that
calculations should not be stored).
--

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Avoid redundant table design Gina Whipp Microsoft Access Database Table Design 0 3rd Dec 2009 06:47 PM
Sumof Maxof Countof Angie Microsoft Access 3 30th Jul 2008 06:47 PM
Average SUMof mutilple cells speakez Microsoft Excel Discussion 2 23rd Jan 2006 01:06 AM
Update Query Using SumOf Jeffrey Microsoft Access Queries 0 7th Aug 2003 06:19 PM
how to avoid accidental changes to table tom mitchell Microsoft Access Getting Started 3 13th Jul 2003 03:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:06 PM.