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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 MAX Aggregate Function

Author  Topic 

ramdas
Posting Yak Master

181 Posts

Posted - 2002-10-03 : 15:52:48
Hi,
I am running the SELECT MAX(Account_balance) FROM Account_data query
and get a response of 999.96 which is wrong. I looked at the data in the table the value is much higher, what could be wrong with the statement.

Bye


Ramdas Narayanan
SQL Server DBA

Andraax
Aged Yak Warrior

790 Posts

Posted - 2002-10-03 : 15:57:36
What datatype is the column Account_balance? If it's a string datatype (varchar, nvarchar etc) the sorting is done literally. If it is float or numeric it sound very strange...

/Andraax

Go to Top of Page

ramdas
Posting Yak Master

181 Posts

Posted - 2002-10-03 : 16:34:04
Hi,
Thanks, The datatype is varchar since it was imported from a .csv file.

Bye

Ramdas Narayanan
SQL Server DBA
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-03 : 16:39:36
You can import CSV data as numeric or date values, as long as they can be implicitly converted. If you need the data treated as numeric then you should change the column to match the appropriate datatype (money, int, float, etc.)

Go to Top of Page
   

- Advertisement -