A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding 2 fields



 
 
Thread Tools Display Modes
  #1  
Old June 15th, 2004, 09:28 PM
Bruce
external usenet poster
 
Posts: n/a
Default Adding 2 fields

I have information in the same table but in seperate fields, how can I add
the contents of one to the other?

Field = Projects + Field = RSS No


Thank you

Bruce


  #2  
Old June 15th, 2004, 11:12 PM
rpw
external usenet poster
 
Posts: n/a
Default Adding 2 fields

Hi Bruce,

If you are wanting to create a new field in your table and update it with the data from two other fields, then consider not doing that. It becomes redundant data and it is also a 'calculated field' - both of which are not considered to be good table design. However, you can do the 'calculation' on a form or a report and view the the information the way you want to see it.

For example, let's say that on your form you have two textboxes. One textbox is named is "txtProjects" and the other is named "txtField". On this form you place new textbox, name it txtProjectField and in the control source property of the new textbox you type:

=[txtProjects]&" - "&[txtField]

When the form is in from view, the new textbox will display something like this:

"RSS - 123"

If you don't want the dash between the two bits of data, write the formula like this:

=[txtProjects]&" "&[txtField]

and it will display "RSS 123".

Hope this helps.
--
rpw


"Bruce" wrote:

I have information in the same table but in seperate fields, how can I add
the contents of one to the other?

Field = Projects + Field = RSS No


Thank you

Bruce



  #3  
Old June 15th, 2004, 11:27 PM
Tim Ferguson
external usenet poster
 
Posts: n/a
Default Adding 2 fields

"Bruce" wrote in
:


I have information in the same table but in seperate fields, how can I
add the contents of one to the other?

Field = Projects + Field = RSS No



In a query. You really don't want to store all three fields.

Tim F

  #4  
Old June 20th, 2004, 01:36 AM
Brad Rosevear
external usenet poster
 
Posts: n/a
Default Adding 2 fields

I want to do the same thing. But the same table will have more
calculation in it. If I can get the first to work then I can figure out
the rest. I want to creat a field "X" and this field will equal "A" +
"B" + "C" -"D". Can somebody help me with the correct syntax?
Thankyou.
Brad

rpw wrote:
Hi Bruce,

If you are wanting to create a new field in your table and update it with the data from two other fields, then consider not doing that. It becomes redundant data and it is also a 'calculated field' - both of which are not considered to be good table design. However, you can do the 'calculation' on a form or a report and view the the information the way you want to see it.

For example, let's say that on your form you have two textboxes. One textbox is named is "txtProjects" and the other is named "txtField". On this form you place new textbox, name it txtProjectField and in the control source property of the new textbox you type:

=[txtProjects]&" - "&[txtField]

When the form is in from view, the new textbox will display something like this:

"RSS - 123"

If you don't want the dash between the two bits of data, write the formula like this:

=[txtProjects]&" "&[txtField]

and it will display "RSS 123".

Hope this helps.


  #5  
Old June 20th, 2004, 01:47 AM
Rick Brandt
external usenet poster
 
Posts: n/a
Default Adding 2 fields

"Brad Rosevear" wrote in message
...
I want to do the same thing. But the same table will have more
calculation in it. If I can get the first to work then I can figure out
the rest. I want to creat a field "X" and this field will equal "A" +
"B" + "C" -"D". Can somebody help me with the correct syntax?


There is NO way to create a field in a table that holds a calculation and there
is no good reason to try. Build a query that has all of the fields in your
table PLUS a calculated field that uses the expression that you want. Then just
substitute the query any place you are currently using the table.


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


  #6  
Old June 22nd, 2004, 01:49 AM
rpw
external usenet poster
 
Posts: n/a
Default Adding 2 fields

Brad,

Can you explain a little more about your need? Is there a reason for storing the results of a calculation in the table? What do "A" and "B", etc. represent - tables, field names, numbers, text, what?

Also, what Rick Brandt stated about having a field in a table do the calculation is correct, although there are methods of updating a table with the results of a calculation. In MOST cases, storing the result of a calculation is redundant and considered to be non-normalized table design, however, there are times when it is advantageous to do so.

Post back to this thread and we'll try to help.

--
rpw


"Brad Rosevear" wrote:

I want to do the same thing. But the same table will have more
calculation in it. If I can get the first to work then I can figure out
the rest. I want to creat a field "X" and this field will equal "A" +
"B" + "C" -"D". Can somebody help me with the correct syntax?
Thankyou.
Brad


 




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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:32 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.