MoreThanDoubled
asked on
query syntax
All,
How can i make 5000.000000 look like 50.00 using a sql statement?
How can i make 5000.000000 look like 50.00 using a sql statement?
select ROUND(5000.00000 / 100, 2)
ASKER
Sabora, this is close but i get 50.000000000 i want 50.00
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
for postgresql, which I'm running here, this works fine.
So what does
select ROUND(50.002, 2)
print in your case?
would expect 50.000000 then, too...
Which DB system are you using?
So what does
select ROUND(50.002, 2)
print in your case?
would expect 50.000000 then, too...
Which DB system are you using?
Surely this will work
SELECT ROUND(COLUMNAME/100,2) FROM TABLENAME`;
Ex :
SELECT ROUND(PSG_SUBTOTAL/100,2) FROM `partssalesgroup`;
if u needs another thing then, try this also
pls change your field datetype like this COLUMNANE DECIMAL(2,2)
SELECT ROUND(COLUMNAME/100,2) FROM TABLENAME`;
Ex :
SELECT ROUND(PSG_SUBTOTAL/100,2) FROM `partssalesgroup`;
if u needs another thing then, try this also
pls change your field datetype like this COLUMNANE DECIMAL(2,2)
SELECT CONVERT(Decimal(9,2),varia ble)
SELECT CONVERT(Decimal(9,2),50000 000.00)
SELECT CONVERT(Decimal(9,2),50000
To answer this question properly, we really need to know which dbms you are using.
What dbms did that solution work for so it can be added to knowledge base.