Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.ms-sqlserver    |    Notorious Rube Goldberg contraption    |    19,505 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 18,799 of 19,505    |
|    Tony Johansson to All    |
|    Re: How do I write this sql statement    |
|    08 Dec 12 14:31:19    |
      From: johansson.andersson@telia.com              Hello!              If I use just this       SELECT SUBSTRING(CId, 9, 4)       FROM cases       I get all the number for example       1001       1002       1003       ...       1130 and so on              But I want the max value from these. I need to use the substring,cast and       max but doesn't know how              It's something like this       SELECT max(cast(SUBSTRING(CId, 9, 4) AS test) as Int))       FROM cases              //Tony               |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca