PC Review


Reply
Thread Tools Rate Thread

A Derived Field

 
 
Garret
Guest
Posts: n/a
 
      21st May 2007
I'd like to insert a derived field into this situation

tblShipments (Parent table)
Shipment_No
Shipment_Size


tblShipment_Inspection (Child table)
Shipment_No (connected field)
Item_Dimension
(part of the item being inspected to see if it is "good")
Number_Out_Tolerance
(number of items in the shipment that are bad for this
dimension)


I'd like to create the field "Der_Percent_Good" that calculates the
percentage of good items in the shipment.
(1 - Number_Out_Tolerance/Shipment_Size)*100.


How would I do this since the tables are related by Shipment_No, but
the actual size of the shipment is in the parent table but the
derived
field would be in the child table.

Thanks!

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SVQtMTk1Nw==?=
Guest
Posts: n/a
 
      21st May 2007
If you wnat a calculated field, you need to do a query. You can even do and
UPDATE query if you would like to save the data permanently.
--
IT1957


"Garret" wrote:

> I'd like to insert a derived field into this situation
>
> tblShipments (Parent table)
> Shipment_No
> Shipment_Size
>
>
> tblShipment_Inspection (Child table)
> Shipment_No (connected field)
> Item_Dimension
> (part of the item being inspected to see if it is "good")
> Number_Out_Tolerance
> (number of items in the shipment that are bad for this
> dimension)
>
>
> I'd like to create the field "Der_Percent_Good" that calculates the
> percentage of good items in the shipment.
> (1 - Number_Out_Tolerance/Shipment_Size)*100.
>
>
> How would I do this since the tables are related by Shipment_No, but
> the actual size of the shipment is in the parent table but the
> derived
> field would be in the child table.
>
> Thanks!
>
>

 
Reply With Quote
 
Roger Carlson
Guest
Posts: n/a
 
      21st May 2007
My question is why you feel you need to store this calculated value.
Although there are good reasons to do so, in the majorities of cases, if the
value can be calculated, you shouldn't store it, just calculate it in a
query, form, or report whenever you need it.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

"Garret" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'd like to insert a derived field into this situation
>
> tblShipments (Parent table)
> Shipment_No
> Shipment_Size
>
>
> tblShipment_Inspection (Child table)
> Shipment_No (connected field)
> Item_Dimension
> (part of the item being inspected to see if it is "good")
> Number_Out_Tolerance
> (number of items in the shipment that are bad for this
> dimension)
>
>
> I'd like to create the field "Der_Percent_Good" that calculates the
> percentage of good items in the shipment.
> (1 - Number_Out_Tolerance/Shipment_Size)*100.
>
>
> How would I do this since the tables are related by Shipment_No, but
> the actual size of the shipment is in the parent table but the
> derived
> field would be in the child table.
>
> Thanks!
>



 
Reply With Quote
 
=?Utf-8?B?Q2hlZXNlX3doaXo=?=
Guest
Posts: n/a
 
      21st May 2007
Hi Garret,

Generally speaking, you don't store 'calculated' fields in a table. What
you do is just plug your formula into a control on your form or report where
you want to see the calculation. That way, when you need to see it or print
it, it's there.....but you don't waste space storing it in a table.

There are exceptions in situations, for example, where you have a value in
your calculation that will change over time. If you don't store the
calculation results in those cases, then when you go back and look at the
calculations for old records they run the calculation 'on the fly' using the
NEW value of the input in your calculation INSTEAD of the value AT THE TIME.

Hope that helps,

CW

"Garret" wrote:

> I'd like to insert a derived field into this situation
>
> tblShipments (Parent table)
> Shipment_No
> Shipment_Size
>
>
> tblShipment_Inspection (Child table)
> Shipment_No (connected field)
> Item_Dimension
> (part of the item being inspected to see if it is "good")
> Number_Out_Tolerance
> (number of items in the shipment that are bad for this
> dimension)
>
>
> I'd like to create the field "Der_Percent_Good" that calculates the
> percentage of good items in the shipment.
> (1 - Number_Out_Tolerance/Shipment_Size)*100.
>
>
> How would I do this since the tables are related by Shipment_No, but
> the actual size of the shipment is in the parent table but the
> derived
> field would be in the child table.
>
> Thanks!
>
>

 
Reply With Quote
 
Garret
Guest
Posts: n/a
 
      21st May 2007
Thanks for all the replies. What I wanted was a "percent good" field
for each dimension of the item.
For example, 100 of item X comes in and is inspected for height,
length, width, etc.
3 out of 100 are bad on height (so 1 - 3/100), 4 out of 100 are bad on
length (1-4/100), etc.

I discovered that I could use a query to just add the Shipment_Size
field and Number_Out_Tolerance field and do my calculations there with
a derived field. You are correct in saying that the values do not
need to be stored.

Hope this helps anyone in the future who has a similar situation.

 
Reply With Quote
 
Susie DBA [MSFT]
Guest
Posts: n/a
 
      21st May 2007
WRONG ANSWER

SQL Server supports calculated fields, you can even persist them; or
index them-- I mean--- Acccess Data Projects doesn't require an update
query to do simple math




On May 21, 10:16 am, IT-1957 <IT1...@discussions.microsoft.com> wrote:
> If you wnat a calculated field, you need to do a query. You can even do and
> UPDATE query if you would like to save the data permanently.
> --
> IT1957
>
>
>
> "Garret" wrote:
> > I'd like to insert a derived field into this situation

>
> > tblShipments (Parent table)
> > Shipment_No
> > Shipment_Size

>
> > tblShipment_Inspection (Child table)
> > Shipment_No (connected field)
> > Item_Dimension
> > (part of the item being inspected to see if it is "good")
> > Number_Out_Tolerance
> > (number of items in the shipment that are bad for this
> > dimension)

>
> > I'd like to create the field "Der_Percent_Good" that calculates the
> > percentage of good items in the shipment.
> > (1 - Number_Out_Tolerance/Shipment_Size)*100.

>
> > How would I do this since the tables are related by Shipment_No, but
> > the actual size of the shipment is in the parent table but the
> > derived
> > field would be in the child table.

>
> > Thanks!- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
Susie DBA [MSFT]
Guest
Posts: n/a
 
      21st May 2007
Roger

performance, performance, performance
have you ever heard of it?

If you had, you'd be using calculated fields with SQL Server and
Access Data Proejct

i"m so sorry that your retard database doesn't support calculated
fields
it just means that you guys should choose a new database

On May 21, 10:36 am, "Roger Carlson" <RogerCarl...@noemail.noemail>
wrote:
> My question is why you feel you need to store this calculated value.
> Although there are good reasons to do so, in the majorities of cases, if the
> value can be calculated, you shouldn't store it, just calculate it in a
> query, form, or report whenever you need it.
>
> --
> --Roger Carlson
> MS Access MVP
> Access Database Samples:www.rogersaccesslibrary.com
> Want answers to your Access questions in your Email?
> Free subscription:
> http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L
>
> "Garret" <SonOfLiberty1...@gmail.com> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > I'd like to insert a derived field into this situation

>
> > tblShipments (Parent table)
> > Shipment_No
> > Shipment_Size

>
> > tblShipment_Inspection (Child table)
> > Shipment_No (connected field)
> > Item_Dimension
> > (part of the item being inspected to see if it is "good")
> > Number_Out_Tolerance
> > (number of items in the shipment that are bad for this
> > dimension)

>
> > I'd like to create the field "Der_Percent_Good" that calculates the
> > percentage of good items in the shipment.
> > (1 - Number_Out_Tolerance/Shipment_Size)*100.

>
> > How would I do this since the tables are related by Shipment_No, but
> > the actual size of the shipment is in the parent table but the
> > derived
> > field would be in the child table.

>
> > Thanks!- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      21st May 2007
"Susie DBA [MSFT]" <s u s i e d b a @ hotmail.com> wrote:

>WRONG ANSWER
>
>SQL Server supports calculated fields, you can even persist them; or
>index them-- I mean--- Acccess Data Projects doesn't require an update
>query to do simple math


Note that this person is really A a r o n K e m p f and that he is not an employee
of Microsoft.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Reply With Quote
 
Susie DBA [MSFT]
Guest
Posts: n/a
 
      24th May 2007
note that tony; and a lot of the other MVPs around here are blindly
PRO-JET because they don't understand some of the benefits of using
Access Data Projects

is it my fault that MS censors my posts?

I'll call myself whatever I want, kids

Tony should be ignored, he is a big fat lazy MDB sloth






On May 21, 2:51 pm, "Tony Toews [MVP]" <tto...@telusplanet.net> wrote:
> "Susie DBA [MSFT]" <s u s i e d b a @ hotmail.com> wrote:
>
> >WRONG ANSWER

>
> >SQL Server supports calculated fields, you can even persist them; or
> >index them-- I mean--- Acccess Data Projects doesn't require an update
> >query to do simple math

>
> Note that this person is really A a r o n K e m p f and that he is not an employee
> of Microsoft.
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Please respond only in the newsgroups so that others can
> read the entire thread of messages.
> Microsoft Access Links, Hints, Tips & Accounting Systems athttp://www.granite.ab.ca/accsmstr.htm
> Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/



 
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
Update field/table from a derived field in another query Wendy Microsoft Access Queries 1 22nd Apr 2008 11:16 AM
Derived Field Garret Microsoft Access 1 21st May 2007 06:04 PM
Derived Field Garret Microsoft Access 0 21st May 2007 02:50 PM
Pivot table, calculating a new field derived from other field, e.g =?Utf-8?B?TWFkaXNvbg==?= Microsoft Excel Misc 1 5th Nov 2004 01:46 AM
Use derived field value to update table field Brown Microsoft Access Form Coding 2 18th Jun 2004 01:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:34 PM.