Forums
This topic is locked
using only part of data
Posted 13 Sep 2004 20:10:05
1
has voted
13 Sep 2004 20:10:05 colin hart posted:
I have a form field that is called MLSNum, well this MLSNum field also is how images are stored on our FTP Server. I have created a page that shows the image name which is simply <%=(rsPropSearch.Fields.Item("MLSNum"
www.somesite.com/images/<%=(rsPropSearch.Fields.Item("MLSNum"

www.somesite.com/images/56/S123456.jpg
how so I make my SQL database only spit out the last 2 numbers in that field?
I am using Macromedia, sql2000 and asp, vbscript
thanks in advance
Replies
Replied 13 Sep 2004 22:54:17
13 Sep 2004 22:54:17 Rene Bandsma replied:
Something like this:
<pre id=code><font face=courier size=2 id=code>
Dim strURL, strDir
'declare your URL
strURL= <%=(rsPropSearch.Fields.Item("MLSNum"
.Value)%>.
'set strDir as the last two numbers
strDir= Right(strURL,2)
'write the URL on the screen
Response.Write "www.somesite.com/images/" & strDir & "/" & strURL
</font id=code></pre id=code>
<pre id=code><font face=courier size=2 id=code>
Dim strURL, strDir
'declare your URL
strURL= <%=(rsPropSearch.Fields.Item("MLSNum"

'set strDir as the last two numbers
strDir= Right(strURL,2)
'write the URL on the screen
Response.Write "www.somesite.com/images/" & strDir & "/" & strURL
</font id=code></pre id=code>