Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 converting data format

Author  Topic 

eem_2055
Yak Posting Veteran

69 Posts

Posted - 2007-11-16 : 01:40:31
hi guys how can I change this format

date|amount
02/25/07| 00.00
02/26/07| 00.00

To
date|amount
02/25/07| 0.00
02/26/07| 0.00
thanks!

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2007-11-16 : 02:39:29
am assuming AMOUNT is currently stored as a string?

you need to cast it as a number. something like...

cast(amount as decimal(5,2))

Em
Go to Top of Page

eem_2055
Yak Posting Veteran

69 Posts

Posted - 2007-11-16 : 04:04:44
Thanks a lot!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-11-19 : 01:48:59
what is the datatype of date? Make sure you used DATETIME datatype

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -