Question: I've below query:

```
DECLARE @url varchar (max)='http://v.mercola.com/blogs/public_blog/New-Diet-Pill-Expands-1-000-Times-in-Your-Stomach-24728.aspx' 
SELECT replace(replace(RIGHT(@URL , CHARINDEX ('/' ,REVERSE(@URL))-1),'.aspx',''),'-',' ') as abc

```

Which returns below output: 

**Actual output** -

[![enter image description here](https://i.stack.imgur.com/5WAhU.jpg)](https://i.stack.imgur.com/5WAhU.jpg)

**Expected output**

[![enter image description here](https://i.stack.imgur.com/BKQJL.jpg)](https://i.stack.imgur.com/BKQJL.jpg)

i.e i want to eliminate the string after last occurrence of `-`.

What changes do i have to make to get the expected output..
In all i want a substring after last occurence of `/` and before last occurence of `-` as shown above.

Please help and thanks in advance...!

Answer: 
I got it working. Actually i am using latest version (1.10.11) of aws-java-sdk and in latest version, joda time dependency has been removed. When i used earlier version (1.8.2), then it worked. 

So if you want to use latest version of aws-java-sdk, then you have to add joda time dependency explicitly.

Thanks
It seems that you're missing `joda-time` dependency as well.

Add it to your dependencies:

```
libraryDependencies += "joda-time" % "joda-time" % "2.9.2"

```