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.
Author |
Topic |
aoyarce
Starting Member
2 Posts |
Posted - 2009-04-09 : 16:07:34
|
i have the next statement:SELECT MAX(temperatura) AS Expr1FROM Tabla1but instead of get the maximun value,i got another value.for example if my column temperatura have the values 1,2,3,4,5and i make the query, instead of get 5, i get 2 and i dont know why.the most extrange is that in the same Tabla1, y have another ten columns, but when i make the same query, i got the right value.can anybody tell me what is wrong with me SQL? |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2009-04-09 : 16:28:16
|
what is the datatype of the column temparatura?Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
|
|
dsindo
Starting Member
45 Posts |
Posted - 2009-04-10 : 15:14:34
|
not much to look at. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
aoyarce
Starting Member
2 Posts |
Posted - 2009-04-13 : 16:06:19
|
the datatype is a nchar(10)but the value that i insert its a float,may be a problem when the number is like 1.123e4?now i add another table with float number,but do the same thing... |
|
|
dsindo
Starting Member
45 Posts |
Posted - 2009-04-14 : 19:51:40
|
you might need to convert the value.select max(cast(temperatura as float)) as exp1 from tabla1 |
|
|
|
|
|
|
|