Welcome to Dream.In.Code
Become an Expert!

Join 150,089 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,785 people online right now. Registration is fast and FREE... Join Now!




Error When Changing Datatype

 
Reply to this topicStart new topic

Error When Changing Datatype

Fygar
18 Sep, 2002 - 05:33 AM
Post #1

I liek milk!!1
Group Icon

Joined: 28 Mar, 2002
Posts: 4,313


Dream Kudos: 50
My Contributions
Alright, I have a column 'GradeValue' that is of char datatype origin. I need to make it a number value so I may average it. Here is my code:

SQL
Select
CASE ISNUMERIC(GradeValue)
WHEN 1 THEN /*SUM*/(CAST((RTRIM(GradeValue)) as float))
ELSE 0
END as GradeVal
, COUNT_BIG(*) AS Count
From dbo.GP9SCLTD GROUP BY GradeValue
Order By GradeVal


Thanks in advance
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: Error When Changing Datatype
18 Sep, 2002 - 06:41 AM
Post #2

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
and what language are we writing in?
User is offlineProfile CardPM
+Quote Post

Fygar
RE: Error When Changing Datatype
18 Sep, 2002 - 06:53 AM
Post #3

I liek milk!!1
Group Icon

Joined: 28 Mar, 2002
Posts: 4,313


Dream Kudos: 50
My Contributions
Ack, sorry

MsSql

Sql Server 2000
User is offlineProfile CardPM
+Quote Post

fyrestorm
RE: Error When Changing Datatype
18 Sep, 2002 - 06:58 AM
Post #4

D.I.C Lover
Group Icon

Joined: 4 Apr, 2002
Posts: 3,103



Thanked: 2 times
Dream Kudos: 228
My Contributions
no wonder that coding didn't look familiar....sorry no help here....
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 11:57PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month