Formating a calculation [message #4367] |
Tue, 03 December 2002 04:44 |
Mark
Messages: 284 Registered: July 1998
|
Senior Member |
|
|
I would be greatful if anyone can help me. I have a query that I would like to format a calculation so it appears to two decimal places. The problem I have is that where the answer is displayed it is in an aliase field which doesn't exist in my table. The aliase is
SORDERITEMVALUE.
SELECT
SOrderItem.SOrderID,
SorderItem.SORDERITEMLINENO,
Product.Description,
PackSize.PackSizeID,
Status.StatusName,
SOrderItem.SORDERITEMDATECREATION,
SOrderItem.SORDERITEMDATEFULFILLED,
SOrderItem.SORDERITEMDATERELEASE,
SOrderItem.SORDERITEMQTY,
SOrderItem.SORDERITEMSTOCKQTY,
SOrderItem.SORDERITEMPRICE,
SOrderItem.SORDERTRADEPRICE,
SOrderItem.SORDERRETAILPRICE,
SOrderItem.SORDERSRETAILPRICE,
SOrderItem.SORDERUNITOFSALE,
SOrderItem.SORDERITEMDESCOR,
(SOrderItem.SOrderItemStockQty * SOrderItem.SOrderItemPrice / SOrderItem.SORDERUNITOFSALE)as SORDERITEMVALUE,
SOrderItem.SOrderItemVatID,
SOrderItem.SOrderItemPriceID
FROM
SOrderItem, Product, Status, PackSize
WHERE
(SorderItem.SOrderItemProductID = Product.ProductID)
AND (SorderItem.SOrderItemStatusID = Status.StatusID)
AND (Product.PackSizeID = PackSize.PackSizeID)
thanks in advanced
mark
|
|
|
Re: Formating a calculation [message #4368 is a reply to message #4367] |
Tue, 03 December 2002 05:00 |
|
Mahesh Rajendran
Messages: 10707 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
SQL> ed
Wrote file afiedt.buf
1* select ename,sal, sal*.33 as "something" from emp
SQL> column something format $99,999.99;
SQL> /
ENAME SAL something
---------- ---------- -----------
SMITH 800 $264.00
ALLEN 1600 $528.00
WARD 1250 $412.50
JONES 2975 $981.75
MARTIN 1250 $412.50
BLAKE 2850 $940.50
CLARK 2450 $808.50
SCOTT 3000 $990.00
KING 5000 $1,650.00
TURNER 1500 $495.00
ADAMS 1100 $363.00
JAMES 950 $313.50
FORD 3000 $990.00
MILLER 1300 $429.00
14 rows selected.
|
|
|