How do I add a column that calculates the product of two fields?

E

Elizabeth

Here's my current SQL code (which works BEAUTIFULLY, by the way! Thank you,
Discussion group for your assistance and allowing me to plagarize, LOL.)

*******

Select [POS_ID],[Posted
Date],[Salesrep],[EndCustomer],[ShipCustomer],[Value],[Reason],[Prod/Serv],[Op],[Region],[AM/Team],[Claim_Split_%],[Order Type],[Report Name]
From [Table - POS]
Union All
Select [POS_ID],[Posted
Date],[Salesrep],[EndCustomer],[ShipCustomer],[Value],[Reason],[Prod/Serv],[Op],[Region],[AM/Team],[Claim_Split_%],[Order Type],[Report Name]
From [Table - Manual]
Union All
Select [POS_ID],[Posted
Date],[Salesrep],[EndCustomer],[ShipCustomer],[Value],[Reason],[Prod/Serv],[Op],[Region],[AM/Team],[Claim_Split_%],[Order Type],[Report Name]
From [Table - Unallocated]
UNION ALL
Select [POS_ID],[Posted
Date],[Salesrep],[EndCustomer],[ShipCustomer],[Value],[Reason],[Prod/Serv],[Op],[Region],[AM/Team],[Claim_Split_%],[Order Type],[Report Name]
From [Table - Unclaimed Sherrel]
UNION ALL Select [POS_ID],[Posted
Date],[Salesrep],[EndCustomer],[ShipCustomer],[Value],[Reason],[Prod/Serv],[Op],[Region],[AM/Team],[Claim_Split_%],[Order Type],[Report Name]
From [Table - Unclaimed POS Carl]

***************

How do I add a column that gives me the product of the "[Value]" times the
"[Claim_split_%]" for each record? Since I created this using SQL, it won't
let me see the query "skeleton" as a table, but I know NOTHING about writing
SQL code...I just copy and paste...so I can't figure out how to edit this
query.

Thanks,
Elizabeth
 
K

KARL DEWEY

Edit the SQL like this ---
Select [POS_ID],[Posted
Date],[Salesrep],[EndCustomer],[ShipCustomer],[Value],[Reason],[Prod/Serv],[Op],[Region],[AM/Team],[Claim_Split_%],[Order
Type],[Report Name], [Value]*[Claim_Split_%] AS MyAnswer
From [Table - POS]
Union All .....

Substitute whatever name you want for the ouput field for MyAnswer,
remembering to enclose in quotes if using a space or other than a letter
character in the name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top