I have this code and it works great for some of the numbers but not ther other.
<%# Mid(DataSet1.FieldValue("ListNum", Container).Trim(), 5,1) %> with a number of 675432 the result would be 3. With a number of 75432 the result would be 2. I need them always be in the 2 spot even if my field has a 7, 6, 5, or 4 digit numbers in it.
This is trimming the ListNum field in my database down to one number. When the database field is 6 numbers long it works perfectly. If the database number is 5 numbers long it selects the last number instead of the 2nd to the last number. Is there a way to get the trim command to count the numbers from the right and not the left. So the code would look something like this.
<%# Mid(DataSet1.FieldValue("ListNum", Container).Trim(), 2,1) %>
Thanks for any help.Try something like this:
Dim myString as string
myString = DataSet1.FieldValue("ListNum", Container).Trim()
myString = myString.Substring(myString.Length-2, 1)
The code is a section out of much more.. Here is the code all together.
<img src="http://pics.10026.com/?src=http://photos.neg.ctimls.com/neg/photos/small/<%# Mid(DataSet1.FieldValue("ListNum", Container).Trim(), 5,1) %>/<%# Right(DataSet1.FieldValue("ListNum", Container).Trim(), 1) %>/<%# DataSet1.FieldValue("ListNum", Container) %>a.jpg" width="100" alt="">
Because it is a piece of a code that is why I can't use something like that. Also there are many of these for one page on the site so I have to keep it as simple as possible.
Thanks
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment