on 06-08-2008 6:05 PM
Hello
I hva emade the following query but I want the gross margin/doc total to be shown in a different format today it is 1 or 0 but it should be shown as a percentage like 10.3 or 20.4
SELECT T0.[DocNum], T0.[CardCode], T0.[CardName], T0.[U_ZREF], T0.[U_ZREF2], T0.[Weight], - T0.[GrosProfit], - T0.[DocTotal], T0.[GrosProfit]/T0.[DocTotal] FROM ORIN T0 WHERE T0.DocDate = '[%0]'
UNION ALL
SELECT T0.[DocNum], T0.[CardCode], T0.[CardName], T0.[U_ZREF], T0.[U_ZREF2], T0.[Weight], T0.[GrosProfit], T0.[DocTotal], T0.[GrosProfit]/T0.[DocTotal] FROM OINV T0 WHERE T0.DocDate = '[%0]'
SELECT T0.[DocNum], T0.[CardCode], T0.[CardName], T0.[U_ZREF], T0.[U_ZREF2], T0.[Weight], - T0.[GrosProfit], - T0.[DocTotal], T0.[GrosProfit]/T0.[DocTotal] FROM ORDN T0 WHERE T0.DocDate = '[%0]'
UNION ALL
SELECT T0.[DocNum], T0.[CardCode], T0.[CardName], T0.[U_ZREF], T0.[U_ZREF2], T0.[Weight], T0.[GrosProfit], T0.[DocTotal], T0.[GrosProfit]/T0.[DocTotal] FROM ODLN T0 WHERE T0.DocDate = '[%0]'
ORDER BY T0.[CardCode]
Thank you for your help
Hi,
Try this one:
SELECT T0.DocNum, T0.CardCode, T0.CardName, T0.U_ZREF, T0.U_ZREF2, T0.Weight, - T0.GrosProfit, - T0.DocTotal, T0.GrosProfit/T0.DocTotal*100 FROM ORIN T0 WHERE T0.DocDate = '[%0]'
UNION ALL
SELECT T0.DocNum, T0.CardCode, T0.CardName, T0.U_ZREF, T0.U_ZREF2, T0.Weight, T0.GrosProfit, T0.DocTotal, T0.GrosProfit/T0.DocTotal*100 FROM OINV T0 WHERE T0.DocDate = '[%0]'
SELECT T0.DocNum, T0.CardCode, T0.CardName, T0.U_ZREF, T0.U_ZREF2, T0.Weight, - T0.GrosProfit, - T0.DocTotal, T0.GrosProfit/T0.DocTotal*100 FROM ORDN T0 WHERE T0.DocDate = '[%0]'
UNION ALL
SELECT T0.DocNum, T0.CardCode, T0.CardName, T0.U_ZREF, T0.U_ZREF2, T0.Weight, T0.GrosProfit, T0.DocTotal, T0.GrosProfit/T0.DocTotal*100 FROM ODLN T0 WHERE T0.DocDate = '[%0]'
ORDER BY T0.CardCode
let me know if you need more detail
Rgds,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.