Select Max

galantis

Registered User.
Local time
Today, 07:05
Joined
Feb 10, 2005
Messages
32
Hi,

My SQL is not really good,

I have a table with
Name
AC01
AC02
AC03
ACS0
ACS1

I would like contruct a SQL such that it returns the highest number excluding the S*.

I thinking along the line of Max(Right(Name,2)) and using Not Like "S*" and maybe using a subquery?

any help will be appreciated.
 
SELECT Max(Right([Name],2)) AS MaxNumber
FROM [TableName]
WHERE [Name] Not Like "*S*"

will return 03.
.
 

Users who are viewing this thread

Back
Top Bottom