<vj*****@at.BioStrategist.dot.dot.comwrote in message
news:gb**********@reader1.panix.com...
*+-If Left([MyString],5) Mod 2 <0 Then
Well, no, that's why I wanted to parse the second token
(ie, the first token end with a hyphen, the second with a space)
More generally, what are the functions Left, Mid & al "called"?
I remember them from GWBasic, and I know they are MicroSoft specific
but not SQL specific.
- = -
Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus, BioStrategist
http://ourworld.compuserve.com/homepages/vjp2/vasos.htm
---{Nothing herein constitutes advice. Everything fully disclaimed.}---
[Homeland Security means private firearms not lazy obstructive guards]
[Urb sprawl confounds terror] [Remorse begets zeal] [Windows is for
Bimbos]
Are you trying to work out which houses are on the left and which on the
right side of the street?
Left(str,3) will give you the three characters on the left of the string
Right(str,3) will give you the three characters on the right of the string
Mid(str,4,2) will give you two characters starting at position 4
Mid(str,4) will give you all the characters starting at position 4 to the
end of the string
INSTR(str," ") will give you the position of a string in another string
So to answer your original question you may want something like:
Txt = "12-34 fred"
i = InStr(Txt, " ")
Tmpstr = Mid(Txt, i - 1, 1)
if Tmpstr Mod 2 then
Though you could combine the formulas into one, it is safer to keep them
seperate so you could do some error checking.
What if there is no space in the string?
What if the first character is a string?
What if Tmpstr is not numeric?
John... Visio MVP