Skip to Content
0
Jun 08, 2008 at 05:05 PM

Format of calculation field in query

16 Views

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