SQLTeam.com | Weblogs | Forums

Removal of trailing zeros from result


#1

Hello, I need to remove six zeros from the result below from this query. How do i do that?
thanks

SELECT
h.cpuspeed as maxclockspeed,
FROM agent_info a
limit 20

Result: maxclockspeed cloumn = 2500000000


#2

What is the data type of that column?


#3

Does SQL Server support that these days? if not might be MySQL?


#4

tara,

its says bigint(20) if thats what you mean?


#5

Hi Kristen, yes its Mysql.


#6

This is an MS SQL Server forum, so you might not find folk here who know answers to MySQL, or the answers given might only work on SQL Server! Probably worth trying a MySQL forum

If you divide the h.cpuspeed by 1000000 does that give you the answer you want (i.e. scaled down by one million)


#7

It does yes as in 2500.0000 but unsure of how to get rid of the four trailing zeros.


#8

This appears to be a problem with your application as a bigint column will not have decimal places. Format the data to whatever bigint maps to in your application code.