Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 30th, 2004, 12:28 AM
Registered User
 
Join Date: Jul 2004
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Storing Calculated Fields

I have a calculated field called Saving which I want to store in the table. I know this isn't advisable, but I need to refer back to it constantly and want to know what the savings are when the information was entered. Does anyone know a way to do this?


Reply With Quote
  #2 (permalink)  
Old August 30th, 2004, 07:31 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Suggestion:

Avoid storing calculated fields. Create a table that stores this information and create a query and do your calculation there.

Take a look at the northwind access database that comes with MS Access

[u]Tables</u>
Order
Order Details

This will give you and idea on how to best approach your situation.


Reply With Quote
  #3 (permalink)  
Old August 30th, 2004, 04:02 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Jemacc's advice is generally very true, but be careful to listen to what is asked. For example, Dearnne says, "...want to know what the savings are when the information was entered."

That raises a flag. Are you saying, Dearnne, that savings is dependent on WHEN it was entered and you need to save the number for historical reasons?

For example: exchange rates. Values based on those can be calculated; however, because exchange rates change daily, you WOULD have to store the actual exchange rate if you want to know what the value of something was from another country on a certain date.

In that case, Dearnne, you don't store the calculated value (listening Jemacc's good advice); you store the multiplier for that date, i.e. the exchange rate itself. Then if you want to know the value of something later, you THEN recalculate using the stored exchange rate.

So my question to you is, are you multiplying two numbers where the second number changes daily? If so, store the second number and its date, not the calculation of the two numbers. As jemacc says, you can recalculate anytime as long as you get the correct two numbers.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #4 (permalink)  
Old September 2nd, 2004, 05:30 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Greg, Isee your point and I agree. If I am keeping my checking account history and I want to keep a running balance. How would I apply your suggestion in order to get a balance on a particular day when I am depositing and also taking money out?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create calculated fields MacDevv C# 3 August 16th, 2006 09:38 AM
Nested Calculated Fields in Queries SerranoG Access 0 August 14th, 2006 10:04 AM
Storing Calculated Fields dearnne Access VBA 1 August 30th, 2004 10:54 AM
Summing the Results of Two Calculated Fields CloudNine Access 1 December 24th, 2003 12:05 PM



All times are GMT -4. The time now is 05:18 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.