|
Posted by Mike on 10/13/05 16:11
Here is my situation;
I have two tables in a MS-SQL DB. One table with dollar amounts and service
codes. I have a second table that I want to move some information into from
the first table. The catch is I want to move one field as is from the first
table to the second, but the rest of the fields in the second table are
calculations based on fields in the first table.
The first table is called XFILE. It has fields SVCCODE, PRICE, DWAGES,
DMATLS, etc. The second table has the same field names and I want to move
the SVCCODE from XFILE to Cost_Percent with no changes. For DWAGES in the
Cost_Percent table I want to do the following calculation;
[ XFILE.DWAGE] divided by [XFILE.PRICE] and put the results in Cost_Percent
table DWAGES field
So basically I am putting a percent in the Cost_Percent table. I can move
the data from one table to another ok, but I can not figure out how to write
the query in the Query Analyzer to do this.
I am ruining SQL2000 Standard on a Win2K3 server. I am using Query Analyzer
and SQL Enterprise Manager from an XP-Pro WS.
I have looked in the 'Books On-Line' for the answer but I sort of new to SQL
and can't find the answer that I am sure is staring me in the face.
Thanks in advance for any help.
Mike Charney
m charney at dunlap hospital dot org
[Back to original message]
|