Re: comparing strings

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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)



.



Relevant Pages

  • Re: comparing strings
    ... Only need to compare the 6.15. ... only going to work for the single digits. ... Dim pos As Long, result As String ... 'this finds the index of the 2nd dot ...
    (microsoft.public.access.formscoding)
  • Re: Is the Curt net a kind of decision tree?
    ... The very simple problem of trying to tell Dot Dash ... decisions based on two separate pulse sources. ... always other pulses to compare to. ...
    (comp.ai.philosophy)
  • Re: K-Nearest Neighbour Confusion
    ... experimental methodology to be able to compare the accuracies of ... word all lower case, then @, then dmu, dot, ac, dot, uk. ...
    (sci.stat.math)
  • Re: RandomAccessFile Seek (find CR)
    ... This project was for a lab, and was meant for use with a specific file. ... pos = Math.abs) % f.length; ... When you compare two strings for equality use the equalsmethod of String rather than compareTo. ... else seek the file back two bytes and go back to read a character ...
    (comp.lang.java.help)
  • Re: How to implement inputing data from a get method?
    ... and use a loop to compare whether temptime equals to current day. ... Use SimpleDateFormat's parseto convert your string to a Date: ... home dot woh dot rr dot com slash jbmatthews ...
    (comp.lang.java.help)