INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

InStr and Mid

InStr and Mid

(OP)
I am trying to figure out someone else's report that I inherited... Can someone explain to me what this formula is doing?

IF InStr({OD.COMMENT1},"*",1) <= 1
THEN ' '
else
MID({OD.COMMENT1},INSTR({OD.COMMENT1},'*')+1,999)

In the first line I get that it is searching for a * in the field. Is it saying if it finds 0 or 1 occurrences to print ' '

on the bottom statement, what is the MID,INSTR, +1, 999 all about?

Thanks!!

RE: InStr and Mid

Looked this up in the Help section of CR.

The optional "1" in the last position of the instr function allows the search to be case insensitive. If you use 0 or omit a number in the last position, the search will be case sensitive.

For the mid function, the 999 is an optional number which tells it to return up to 999 characters starting with the indicated start position ("*"+1). The instr function in the middle of the function says where the new string should start (1 character after the numeric position of "*"). If you omit the 999, the mid function should return the entire text following the start position.

Check the help section--it is actually very helpful.

-LB

RE: InStr and Mid

GCL2007

You have posted 2 questions in the last 10 days and have received 2 answers, yet you have not even bothered to acknowledge those responses or indicated if they helped.

I suggest that you at least thank those who make the effort to assist you, and perhaps even give them a purple star if the suggestions answered your question. As well as showing your appreciation it also indicates to others searching the threads that the solution provided was helpful.


Pete.

RE: InStr and Mid

(OP)
Thanks Pete, You are absolutely right.. Thanks Lbass (as always, you have saved me a few times in the past).. With the holidays I really haven't been able to dig into lbass's notes in detail but definitely will..

RE: InStr and Mid

(OP)
Thanks LB... Makes sense now...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close