By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 2,292 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Adding Values in Table

P: n/a
I've got two columns that I want to add the values and then insert it
into the table as a new column. I've got the query as such:

Select [Sold YTD]+[Used YTD] As Total_YTD
>From Parts;
The problem I run into is how do I then take the results Total_YTD and
insert it back into the table.
Any insights would be greatly appreciated. Thanks.

Nov 17 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
First, If you can readily calculate it why store it?

If you have a reason for storing, try:
1. Add the Total_YTD column to the table.
2. Change query to

UPDATE tblTableName
SET tblTableName.Total_YTD =
(tblTableName.[Sold YTD] = tblTableName.[Used YTD]);

Kevin C

"JJM0926" <jj*****@gmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
I've got two columns that I want to add the values and then insert it
into the table as a new column. I've got the query as such:

Select [Sold YTD]+[Used YTD] As Total_YTD
>>From Parts;

The problem I run into is how do I then take the results Total_YTD and
insert it back into the table.
Any insights would be greatly appreciated. Thanks.

Nov 17 '06 #2

P: n/a

Kc-Mass wrote:
First, If you can readily calculate it why store it?

If you have a reason for storing, try:
1. Add the Total_YTD column to the table.
2. Change query to

UPDATE tblTableName
SET tblTableName.Total_YTD =
(tblTableName.[Sold YTD] = tblTableName.[Used YTD]);

Kevin C

"JJM0926" <jj*****@gmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
I've got two columns that I want to add the values and then insert it
into the table as a new column. I've got the query as such:

Select [Sold YTD]+[Used YTD] As Total_YTD
>From Parts;
The problem I run into is how do I then take the results Total_YTD and
insert it back into the table.
Any insights would be greatly appreciated. Thanks.
Thanks. The Update query above worked

Nov 17 '06 #3

P: n/a
Hope you noticed the typo on the secodn equal sign.
"JJM0926" <jj*****@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
>
Kc-Mass wrote:
>First, If you can readily calculate it why store it?

If you have a reason for storing, try:
1. Add the Total_YTD column to the table.
2. Change query to

UPDATE tblTableName
SET tblTableName.Total_YTD =
(tblTableName.[Sold YTD] = tblTableName.[Used YTD]);

Kevin C

"JJM0926" <jj*****@gmail.comwrote in message
news:11**********************@h54g2000cwb.googleg roups.com...
I've got two columns that I want to add the values and then insert it
into the table as a new column. I've got the query as such:

Select [Sold YTD]+[Used YTD] As Total_YTD
From Parts;

The problem I run into is how do I then take the results Total_YTD and
insert it back into the table.
Any insights would be greatly appreciated. Thanks.

Thanks. The Update query above worked

Nov 17 '06 #4

P: n/a
Yeah I notived it. I ran into a little snag. It inserted the results
into the table, but inserted it as text--how do I insert it as an
integer or numeric value not text. Thanks.

Kc-Mass wrote:
Hope you noticed the typo on the secodn equal sign.
"JJM0926" <jj*****@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...

Kc-Mass wrote:
First, If you can readily calculate it why store it?

If you have a reason for storing, try:
1. Add the Total_YTD column to the table.
2. Change query to

UPDATE tblTableName
SET tblTableName.Total_YTD =
(tblTableName.[Sold YTD] = tblTableName.[Used YTD]);

Kevin C

"JJM0926" <jj*****@gmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
I've got two columns that I want to add the values and then insert it
into the table as a new column. I've got the query as such:

Select [Sold YTD]+[Used YTD] As Total_YTD
From Parts;

The problem I run into is how do I then take the results Total_YTD and
insert it back into the table.
Any insights would be greatly appreciated. Thanks.
Thanks. The Update query above worked
Nov 21 '06 #5

P: n/a
In the design view of your table make sure that you have defined
the new field, Total _YTD as data type "Number"

"JJM0926" <jj*****@gmail.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
Yeah I notived it. I ran into a little snag. It inserted the results
into the table, but inserted it as text--how do I insert it as an
integer or numeric value not text. Thanks.

Kc-Mass wrote:
>Hope you noticed the typo on the secodn equal sign.
"JJM0926" <jj*****@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegr oups.com...
>
Kc-Mass wrote:
First, If you can readily calculate it why store it?

If you have a reason for storing, try:
1. Add the Total_YTD column to the table.
2. Change query to

UPDATE tblTableName
SET tblTableName.Total_YTD =
(tblTableName.[Sold YTD] = tblTableName.[Used YTD]);

Kevin C

"JJM0926" <jj*****@gmail.comwrote in message
news:11**********************@h54g2000cwb.googleg roups.com...
I've got two columns that I want to add the values and then insert
it
into the table as a new column. I've got the query as such:

Select [Sold YTD]+[Used YTD] As Total_YTD
From Parts;

The problem I run into is how do I then take the results Total_YTD
and
insert it back into the table.
Any insights would be greatly appreciated. Thanks.
Thanks. The Update query above worked

Nov 21 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.