473,383 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

InStr Return type

A textual comparison starting at position 4. Returns 6.
MyPos = Instr(4, SearchString, SearchChar, 1)


' A binary comparison starting at position 1. Returns 9.
MyPos = Instr(1, SearchString, SearchChar, 0)

' Comparison is binary by default (last argument is omitted).
MyPos = Instr(SearchString, SearchChar) ' Returns 9.

MyPos = Instr(1, SearchString, "W") ' Returns 0.

Can anyone tell me how this is returning 6 and 9.
Dec 15 '06 #1
2 2170
willakawill
1,646 1GB
A textual comparison starting at position 4. Returns 6.
MyPos = Instr(4, SearchString, SearchChar, 1)


' A binary comparison starting at position 1. Returns 9.
MyPos = Instr(1, SearchString, SearchChar, 0)

' Comparison is binary by default (last argument is omitted).
MyPos = Instr(SearchString, SearchChar) ' Returns 9.

MyPos = Instr(1, SearchString, "W") ' Returns 0.

Can anyone tell me how this is returning 6 and 9.
Hi
When you use instr in textual comparison with a 1 as the last argument, it is not case sensitive so it will find upper or lowercase matches, the binary compare will only find the same case as the search character.

so in textual comparison looking for 'P' it will find both 'p' and 'P'
in binary comparison it will only find 'P'
Dec 15 '06 #2
Hi
When you use instr in textual comparison with a 1 as the last argument, it is not case sensitive so it will find upper or lowercase matches, the binary compare will only find the same case as the search character.

so in textual comparison looking for 'P' it will find both 'p' and 'P'
in binary comparison it will only find 'P'

Thanks mam. now i m clear with the concept.
Dec 18 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: J. Muenchbourg | last post by:
I have a field name "tracks" of string data type that has multiple names in it (for example: calder delaware$ aqueduct ), and I want to check to see if this certain field has "delaware$" in it....
5
by: DTB | last post by:
I am trying to convert a complex function from Oracle to SQL Server and have come across Oracle's Instr() function. I see SQL Server has CHARINDEX() which is similar, however it does not provide...
1
by: Icaro | last post by:
Hi everybody, I was looking for an equivalent ORACLE INSTR Function in MSSQL but I donīt found it and I donīt know if it exist so I must to write it and this is the code. Maybe it will be...
1
by: john | last post by:
Ran Windows update tonight. Since then I get this error: HTTP 500.100 - Internal Server Error - ASP error Internet Information Services ...
6
by: Patrick A | last post by:
All - I have the following in the Field row of a column in a query that runs fine against a local table: MSA: InStr(!!,!) I'm now trying to run the query against a linked DB2 table. I get...
4
by: Morten Snedker | last post by:
Scenario: From a given folder all files from all subdirs are read. These are dropped in a one-dimensional array - myArray. Once everything is in my array it is sorted and dropped in a listbox. ...
6
by: Chris Calzaretta | last post by:
Hello Everybody, Question instr function will give you the first instance of the finding so EX: so your string looks like string1 = "testing>This is > just a test > testtesttest"...
12
by: rodchar | last post by:
hey all, i'm getting a result that i don't understand i have a string "test1, test2" If InStr("test1") and InStr("test2") Then 'Inside EndIf The inside is not running for some reason. Any...
3
by: Kubie | last post by:
I'm having problems finding the syntax/comands that do the this correctly. I'm must not be doing the join right or something.. List one AAC1234 CDA2w31 12ZZC12 12TRE1 23234 243
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.