I need to remove the last 10 characters from a string and then display the remaining characters e.g if the string value is area-centre-servers, I wish to display only area-centre.
I think that I have an idea how to do this, but cannot seem to get the syntax right. Please see the code below where area = varchar (64)
select distinct area,substring(area,1,areadisplay),count(*)as servertotal
(select len(area)-8 as areadisplay from unit)
from unit
where area like '%server%'
group by area
Any help is much appreciated
I think that I have an idea how to do this, but cannot seem to get the syntax right. Please see the code below where area = varchar (64)
select distinct area,substring(area,1,areadisplay),count(*)as servertotal
(select len(area)-8 as areadisplay from unit)
from unit
where area like '%server%'
group by area
Any help is much appreciated