473,792 Members | 2,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

updating a lot of calc values that were not stored in the tables

I am working on a database that has a lot of calculated values on the
forms. These were never put into the tables. But were tied to unbound
fields on the forms.
Now 8000 records later they want these values in the tables.
All of this is done in modules after update of certain values entered
on the forms.
The calculations are called on current of the forms so they are
recalculated each time the form is opened.

I have no idea why it was not stored in the tables and the creators
are long gone.

can I do a query that updates fields and call functions in a module to
update with?

Its kinda convoluted since some of these are based on other table
values and then this produces some values that are used to calculate
some of the other values.

To calc B -- you calc A (this will be stored now) based on values in a
lookup table then use this to calc B(new stored value)

thanks for any ideas. I can scroll thru all records and have to forms
update each record ....NOT a good idea with 8000 records LOL
Oct 3 '08 #1
7 1771
It sounds like the values you are trying to retrieve are/were summary
type values - count of Totals for some parameter(s) perhaps? And thus
not stored.

The point of storing summary type values would be if the snapshot of
that data were no longer available. Example: you have an active data
table and a history data table. You want to summary the Active table at
some point in time and store these summary values because the active
table will change and that particular snapshot will no longer be
available.

But if the values were a count of items for a given data period - those
items would still be in your system and you could run a query to
re-summarize those values as many times as you want. Thus, no need to
store these values assuming the data for those parameters has not
changed. This would be like a static table.

If your table(s) is/are static - just create some queries to
re-summarize your values. If you need help with that -then post some
samples of the data you need to calculate.

If you table(s) is/are dynamic - like my active table example - where
you need to store a snapshot of the summary of the active table at some
point in time - this will be more difficult. But it sounds like your
tables are the static type that only collect data.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Oct 3 '08 #2
No its static values.
All I can say is the boss came to me and said where is this data?
I looked at the database and said they are being calculated on each
record for display only.
He asked why?
I laughed and said how the F do I know...ok I said that to myself
LOL
I checked and the people who did it are long gone.
This should have been put in the tables I have no way of knowing why
it wasn't done. I bet there was a reason but ???

On 03 Oct 2008 20:08:08 GMT, Rich P <rp*****@aol.co mwrote:
>It sounds like the values you are trying to retrieve are/were summary
type values - count of Totals for some parameter(s) perhaps? And thus
not stored.

The point of storing summary type values would be if the snapshot of
that data were no longer available. Example: you have an active data
table and a history data table. You want to summary the Active table at
some point in time and store these summary values because the active
table will change and that particular snapshot will no longer be
available.

But if the values were a count of items for a given data period - those
items would still be in your system and you could run a query to
re-summarize those values as many times as you want. Thus, no need to
store these values assuming the data for those parameters has not
changed. This would be like a static table.

If your table(s) is/are static - just create some queries to
re-summarize your values. If you need help with that -then post some
samples of the data you need to calculate.

If you table(s) is/are dynamic - like my active table example - where
you need to store a snapshot of the summary of the active table at some
point in time - this will be more difficult. But it sounds like your
tables are the static type that only collect data.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Oct 6 '08 #3
On Mon, 06 Oct 2008 11:33:11 GMT, sparks <sp****@comcast .netwrote:
>No its static values.
All I can say is the boss came to me and said where is this data?
I looked at the database and said they are being calculated on each
record for display only.
He asked why?
I laughed and said how the F do I know...ok I said that to myself
LOL
I checked and the people who did it are long gone.
This should have been put in the tables I have no way of knowing why
it wasn't done. I bet there was a reason but ???
The reason is "normalization" . Don't clutter up the database with values that
can be calculated.

Does your boss want to change any of the calculated data?
If yes. explain to your boss why it is calculated.
If not then:
Teach your boss to look at reports, not tables.
Or
Generate Excel files and let you boss look at those.
Or
Make new fields in the tables to hold the calculated data. Run the query where
the calculations are being made. Change the query to an update query. Update
all the calculated data to the new fields in the table(s) that the query is
based on. Change query back to Select Query.
Not good practice, but you can live with it if it makes your boss happy.

Chuck
--
>

On 03 Oct 2008 20:08:08 GMT, Rich P <rp*****@aol.co mwrote:
>>It sounds like the values you are trying to retrieve are/were summary
type values - count of Totals for some parameter(s) perhaps? And thus
not stored.

The point of storing summary type values would be if the snapshot of
that data were no longer available. Example: you have an active data
table and a history data table. You want to summary the Active table at
some point in time and store these summary values because the active
table will change and that particular snapshot will no longer be
available.

But if the values were a count of items for a given data period - those
items would still be in your system and you could run a query to
re-summarize those values as many times as you want. Thus, no need to
store these values assuming the data for those parameters has not
changed. This would be like a static table.

If your table(s) is/are static - just create some queries to
re-summarize your values. If you need help with that -then post some
samples of the data you need to calculate.

If you table(s) is/are dynamic - like my active table example - where
you need to store a snapshot of the summary of the active table at some
point in time - this will be more difficult. But it sounds like your
tables are the static type that only collect data.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Oct 6 '08 #4
Well since one value is based on the previous value(s) I had to make
10 update queries to put the calculated values in the table.
It worked and they have all the values in the tables.
on the forms I tied the unbound fields to these value so any new data
or changes to existing values are put into the tables too.
one question some of these update queries are tied to functions that
open lookup tables so they take some time to run. (6 to 15 seconds) on
the 8000 records.
Just for my future info is there a way to call each query in a
function 1 to 10 so that it runs 1, finishes, then runs 2....etc
On Mon, 06 Oct 2008 10:09:47 -0400, Chuck <li*****@school link.net>
wrote:
>On Mon, 06 Oct 2008 11:33:11 GMT, sparks <sp****@comcast .netwrote:
>>No its static values.
All I can say is the boss came to me and said where is this data?
I looked at the database and said they are being calculated on each
record for display only.
He asked why?
I laughed and said how the F do I know...ok I said that to myself
LOL
I checked and the people who did it are long gone.
This should have been put in the tables I have no way of knowing why
it wasn't done. I bet there was a reason but ???
The reason is "normalization" . Don't clutter up the database with values that
can be calculated.

Does your boss want to change any of the calculated data?
If yes. explain to your boss why it is calculated.
If not then:
Teach your boss to look at reports, not tables.
Or
Generate Excel files and let you boss look at those.
Or
Make new fields in the tables to hold the calculated data. Run the query where
the calculations are being made. Change the query to an update query. Update
all the calculated data to the new fields in the table(s) that the query is
based on. Change query back to Select Query.
Not good practice, but you can live with it if it makes your boss happy.

Chuck
Oct 6 '08 #5
sparks wrote:
No its static values.
All I can say is the boss came to me and said where is this data?
I looked at the database and said they are being calculated on each
record for display only.
He asked why?
I laughed and said how the F do I know...ok I said that to myself
LOL
I checked and the people who did it are long gone.
This should have been put in the tables I have no way of knowing why
it wasn't done. I bet there was a reason but ???
Because they should NOT have been. Whoever set it up did it correctly.
Your boss is wrong.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Oct 6 '08 #6
On Mon, 06 Oct 2008 18:26:54 GMT, sparks <sp****@comcast .netwrote:
>Well since one value is based on the previous value(s) I had to make
10 update queries to put the calculated values in the table.
It worked and they have all the values in the tables.
on the forms I tied the unbound fields to these value so any new data
or changes to existing values are put into the tables too.
one question some of these update queries are tied to functions that
open lookup tables so they take some time to run. (6 to 15 seconds) on
the 8000 records.
Just for my future info is there a way to call each query in a
function 1 to 10 so that it runs 1, finishes, then runs 2....etc

You can make a macro that calls the queries one after another.

Chuck
Oct 7 '08 #7

"Rick Brandt" <ri*********@ho tmail.comwrote
Because they should NOT have been. Whoever set
it up did it correctly. Your boss is wrong.
And, to Rick's comment, I'll add... unless the application is trashed,
sooner or later, you or someone else will be back with a problem -- "the
stored value does not match what would be calculated; how do I fix it?" And
the answer will be "don't store values that can be calculated when they are
needed". And the comment will be: "because sooner or later, they will rise
up like an alligator from the swamp through which you are slogging and bite
you in the tender places".

But, if your boss is willing to pay to foul up the design, and then will be
willing to pay to fix the problems he brought about, who are we to say what
he should do?

Larry Linson
Microsoft Office Access MVP
Oct 7 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
16230
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? 1) simply UPDATING the values for all fields in the table, whether or not any particular field has actually changed 2) running a second SELECT statement and comparing the $_POST vars to the returned values, and only UPDATING those that have...
3
2785
by: Robin Tucker | last post by:
Hi there, I have a database on my test machine that will need to be installed on users machines. I would like to create the database with the given schema on the users machine and also with some suitable default values in the tables. I note that although I can script the schema so that re-creating the structure of the database is simple on the users machine, I cannot script the contents of the tables also (automatically). What I would...
1
2965
by: SJH | last post by:
I have been given an older database and asked to make upgrades and what not. One interesting thing I have come across with the database is that it was at one time set up so one of the tables would hold values that were calcuated using a form. I have looked at the code for all the text boxes on the assocatied forms and have yet to figure out how this was done. There were two values set up this way, one still works and the other one...
4
2025
by: Darrel | last post by:
I'm creating a table that contains multiple records pulled out of the database. I'm building the table myself and passing it to the page since the table needs to be fairly customized (ie, a datagrid isn't going to work). On this page, people can update a variet of records. On submit, I want to then go in and update all of the records. Normally, I'd make each form element include a runat: server and then declare it in my codebhind so I...
10
5686
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1) DsStudentCourse1.AcceptChanges() i'm also wondering because w/ out AcceptChanges the data is still save into the database and it is now faster.
4
2376
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has two fields: a primary key and another holding a string. In table B there are three fields: a primary key, a foreign key (which links to the primary key in A) and other field holding a string.
2
13969
by: susan.f.barrett | last post by:
Hi, Despite me being able to type the following in to SQL Server and it updating 1 row: > updatestockcategory 1093, 839 In my code, it is not updating any rows. dataSet = new DataSet();
33
3355
by: bill | last post by:
In an application I am writing the user can define a series of steps to be followed. I save them in a sql database using the field "order" (a smallint) as the primary key. (there are in the range of 20 steps) On the admin page the steps are listed, in "order" order and the user can create new steps and assign an order and all is well. The problem may come in using a renumber function which should take the steps in their current order...
2
3119
by: tasmontique | last post by:
I am working on an access 2002 flight schedule database. I am new to access but have some basic understanding of sql and vb6 code. I have learned a lot from this website. Thanks much Hopefully you can help me with this one. This database handles a varying number of flights for a varying number of days for a varying number of months. I have a number of tables as follows. I tried to normalize to the best of my ability.
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.