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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Sql Server2008 - Select Query Problem ?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

paramu
Posting Yak Master

151 Posts

Posted - 09/18/2010 :  02:19:48  Show Profile  Reply with Quote
Hi,

My Query :

"select m.req_number,(0+m.quantity) as req_quantity from matrequest m"

The above select Query from table MatRequest and the field Quantity is varchar(15).

But the problem is when the data is like decimal its giving error
"converion failed when converting the varchar value '2.5' to data type int."

So how to solve this problem?

Thanks for the Ideas


Paramu @ PARANTHAMAN

webfred
Flowing Fount of Yak Knowledge

Germany
8781 Posts

Posted - 09/18/2010 :  05:54:48  Show Profile  Visit webfred's Homepage  Reply with Quote
select
m.req_number,
convert(decimal(12,2),m.quantity) as req_quantity
from matrequest m


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

paramu
Posting Yak Master

151 Posts

Posted - 09/18/2010 :  06:26:21  Show Profile  Reply with Quote
Thanks WebFred ! You guided me Lot! Many things I learned from you !
Thanks

Paramu @ PARANTHAMAN
Go to Top of Page

webfred
Flowing Fount of Yak Knowledge

Germany
8781 Posts

Posted - 09/18/2010 :  07:24:59  Show Profile  Visit webfred's Homepage  Reply with Quote
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000