Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Trailing Zeros
Hi guys....

I have a field in one of my tables of type Numeric(10, 5).

I would like to convert the data into a varchar, but I want to be rid of all
trailing zeros.  So, 123.12000 would look like 123.12, and 123.00000 would
look like 123

Any ideas?

Thanks,

Forch

Report this thread to moderator Post Follow-up to this message
Old Post
Forch
03-31-05 12:03 AM


RE: Trailing Zeros
try a double conversion
ie select   convert(char,(conver
t(money,field))) from.......

"Forch" wrote:

> Hi guys....
>
> I have a field in one of my tables of type Numeric(10, 5).
>
> I would like to convert the data into a varchar, but I want to be rid of a
ll
> trailing zeros.  So, 123.12000 would look like 123.12, and 123.00000 would
> look like 123
>
> Any ideas?
>
> Thanks,
>
> Forch

Report this thread to moderator Post Follow-up to this message
Old Post
jrpm
03-31-05 12:03 AM


Re:Trailing Zeros
This will come closer.

declare @t numeric(10,5)
set @t = 123.00000
select  convert(varchar,cast
(@t as money),1)

Thanks
Hari
 ____________________
________________
Forch  Wrote:

Hi guys....

I have a field in one of my tables of type Numeric(10, 5).

I would like to convert the data into a varchar, but I want to be rid of all
trailing zeros.  So, 123.12000 would look like 123.12, and 123.00000 would
look like 123

Any ideas?

Thanks,

Forch







Sent via SreeSharp NewsReader http://www.SreeSharp.com

Report this thread to moderator Post Follow-up to this message
Old Post
Hari Prasad
03-31-05 12:03 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 02:06 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006