J
Jetsam
Guest
i need to order by part of a varchar field, such as the example below does for oracle:
i've searched and searched yet i cannot find how to do this for access. ive done this a million times for oracle with a decode in the order by, but how do i use the case statement for access? the following does not work:
thanks for any help!
Code:
select name
from something.somethingelse
order by decode(upper(substr(name,1,3)),'THE',substr(name,5),name)
i've searched and searched yet i cannot find how to do this for access. ive done this a million times for oracle with a decode in the order by, but how do i use the case statement for access? the following does not work:
Code:
select name
from something
order by
case when Ucase(Mid(name,1,3)) = "THE" then Mid(name,4,Len(name)-4)
else name
end
thanks for any help!