dbTalk Databases Forums  

making a field = product of two other fields

comp.database.ms-access comp.database.ms-access


Discuss making a field = product of two other fields in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ryan
 
Posts: n/a

Default making a field = product of two other fields - 10-15-2003 , 07:19 PM






I'm trying to make a field 'value' that is equal to 'cost' *
'quantity'.

I'm new to databases, and this seems like it should be fairly simple.
So far it hasn't been.

Since writing a formula spreadsheet style hasn't worked, I manged to
make a query that will calculate the values I want. Using

Value: components!quantity*components![Cost per Unit]

as the query Field, the query returns the correct data, but how can I
make it store the data in the components.value field?

Thanks for any and all help,
Ryan

Reply With Quote
  #2  
Old   
mharness
 
Posts: n/a

Default Re: making a field = product of two other fields - 10-15-2003 , 09:20 PM






Ryan,

You could use your product expression in an update query to do this but it's
usually preferable to just calculate a value like this whenever you need it
instead of storing it.

Mike

"Ryan" <please.reply.to.group (AT) thanks (DOT) com> wrote

Quote:
I'm trying to make a field 'value' that is equal to 'cost' *
'quantity'.

I'm new to databases, and this seems like it should be fairly simple.
So far it hasn't been.

Since writing a formula spreadsheet style hasn't worked, I manged to
make a query that will calculate the values I want. Using

Value: components!quantity*components![Cost per Unit]

as the query Field, the query returns the correct data, but how can I
make it store the data in the components.value field?

Thanks for any and all help,
Ryan



Reply With Quote
  #3  
Old   
Ray
 
Posts: n/a

Default Re: making a field = product of two other fields - 10-16-2003 , 02:53 AM



Ryan <please.reply.to.group (AT) thanks (DOT) com> wrote

Quote:
I'm trying to make a field 'value' that is equal to 'cost' *
'quantity'.

I'm new to databases, and this seems like it should be fairly simple.
So far it hasn't been.

Since writing a formula spreadsheet style hasn't worked, I manged to
make a query that will calculate the values I want. Using

Value: components!quantity*components![Cost per Unit]

as the query Field, the query returns the correct data, but how can I
make it store the data in the components.value field?

Thanks for any and all help,
Ryan
Hell Ryan,

Seems to me you have already achieved what you want. Regarding
Access and the way things work, you don't need to save the value
of the two fields. Just continue doing what you already did.

Create your expression in the query which can be a source for your
form and for any reports that need to be printed. Or, for that
matter, if the data needs to be exported into Excel or whatever.

Again, you don't and shouldn't, in this situation, need to save
your result. Just do what you did.

Regards,

Ray


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.