Re: How to convert 1223/100 to 12.23 not 12 in sql server?
- From: "spod" <dutthenewt@xxxxxxxxxxx>
- Date: 19 Aug 2005 19:14:05 -0700
TaeHo Yoo wrote:
> I have a column called "Amount" and this field contains amount as cents.
> So when I get the values of it, I do like "select amount / 100 as
> amount" which basically ignores cents. Do you know how to get cents?
>
> Thanks a lot
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
Hi YaeHo
You can use convert here i think. eg... (in query analyser )
drop table foo
create table foo
(
amount int not null
)
go
insert foo( amount ) values( 94)
go
insert foo( amount ) values (10)
go
select convert( float , amount )/ 10 from foo
.
- References:
- How to convert 1223/100 to 12.23 not 12 in sql server?
- From: TaeHo Yoo
- How to convert 1223/100 to 12.23 not 12 in sql server?
- Prev by Date: How to convert 1223/100 to 12.23 not 12 in sql server?
- Next by Date: Re: static virtual/override
- Previous by thread: How to convert 1223/100 to 12.23 not 12 in sql server?
- Next by thread: RE: How to convert 1223/100 to 12.23 not 12 in sql server?
- Index(es):
Relevant Pages
|