reverse a string

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi,
I try reverse() and instrrev, but they don't work.

select reverse(field1) from table1.

Anyone knows how to solve it?
I use MS Access 2000
Thanks,
 
From my file ---

Function ReverseString(StrIngToReverse As String) As String
Dim i As Integer
For i = Len(StringToReverse) To 1 Step -1
ReverseString = ReverseString & Mid(strIn, i, 1)
Next i
End Function
Example:

ReverseString ("Mary had a little lamb") returns "bmal elttil a dah yraM"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top