Re: comparing strings
- From: JohnE <JohnE@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 2 Apr 2009 14:23:02 -0700
Used what you sent, tweaked things a bit and it is working. My headache is
going away.
Thanks.
.... John
"Stuart McCall" wrote:
"JohnE" <JohnE@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message.
news:E8A7EE56-9DC6-402B-B005-15D6AF256FE1@xxxxxxxxxxxxxxxx
Hello. I have a situation in which I need to compare a text string in the
front end to the db field in the back end sql 2005 table. An example is
if
the front end text field is 6.0.1, the table could have 6.0.2. This will
throw an error. What I would like to do is compare only up to the second
dot. But, a caveat here is that the numbers could be double digits
(6.15.5).
Only need to compare the 6.15. I am lost on this. I used Left() which is
only going to work for the single digits. Need something more flexible.
Any help is appreciated.
Thanks.
John
Assuming there will always be two dots:
Dim pos As Long, result As String
'this finds the index of the 2nd dot
pos = InstrRev(BackEndString, ".")
'which we use to extract the numerics
result = Left$(BackEndString, pos - 1)
- References:
- comparing strings
- From: JohnE
- Re: comparing strings
- From: Stuart McCall
- comparing strings
- Prev by Date: Re: Currency
- Next by Date: Re: comparing strings
- Previous by thread: Re: comparing strings
- Next by thread: Re: comparing strings
- Index(es):
Relevant Pages
|