![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| [SOLVED] How to find the maximum value among a list of alpanumeric characters in a da ...in asp.net query? I have a database column "AssetID" with values like ser1.... ser9, ser10, ser11, met1, met2.etc I want an sql query which would retrieve me the highest value among the category "ser" i.e. it should get me the value ser11. If I use max(AssetID) in the query, I get only ser9 and not ser11. So how this is possible? |
| |
| |||
| When you try to sort or pull a max value from a TEXT field, sorting won't be the same as a numeric field. A text sort will sort by ranking on a per character basis. So, ser9 will be a "higher" value than ser11 because the function considers "ser9" higher than "ser1xxxxxxxxx....". The Data Analyst - http://www.squidoo.com/thedataanalyst |
| |||
| Yes that is possible.you can use Compute("MAX) connection.Open(); OleDbCommand mycommand = new OleDbCommand(); mycommand.Connection = connection; DataTable categories = GetDataTable("categories", "SELECT * FROM categories", connection); string orders = categories.Compute("MA id_category)", "").ToString(); |
![]() |
| Thread Tools | |
| Display Modes | |
| |