Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 inStr function but add "+1" to the value, inStr

views
     
TSNGV22
post May 18 2020, 09:17 PM, updated 4y ago

On my way
****
Junior Member
613 posts

Joined: Feb 2014


Hi coders,

This should be a simple question

This works
Left([EmailAddress],inStr([EmailAddress],"."))

when i add +1, it doesnt work
Left([EmailAddress],inStr([EmailAddress],".")+1)

when i add Count only, no error
Left([EmailAddress],Count(inStr([EmailAddress],".")))

But when i add +1 again, error
Left([EmailAddress],Count(inStr([EmailAddress],"."))+1)

I just need to add 1 to the value returned by inStr. Helppp rclxub.gif

This post has been edited by NGV22: May 18 2020, 09:19 PM
bumpo
post May 19 2020, 10:07 AM

On my way
****
Junior Member
632 posts

Joined: Mar 2013


not sure exactly which language this is but i'm going to guess you need to use some "sum" or "add" function to handle your +1
kevinlim001
post May 20 2020, 10:11 AM

Ethical Hacker
*******
Senior Member
6,118 posts

Joined: May 2006
From: Planet called "EARTH"



QUOTE(NGV22 @ May 18 2020, 09:17 PM)
Hi coders,

This should be a simple question

This works
Left([EmailAddress],inStr([EmailAddress],"."))

when i add +1, it doesnt work
Left([EmailAddress],inStr([EmailAddress],".")+1)

when i add Count only, no error
Left([EmailAddress],Count(inStr([EmailAddress],".")))

But when i add +1 again, error
Left([EmailAddress],Count(inStr([EmailAddress],"."))+1)

I just need to add 1 to the value returned by inStr. Helppp  rclxub.gif
*
its not a hard question but i dont know how to help as you didnt mention which syntax language is this. VBA? MySQL?

when u say it doesnt work you double check if the result returned is actually interger before u add + 1. I am not sure what is the return result if the return result is NA NULL those cannot be added with 1. U debug and see.

 

Change to:
| Lo-Fi Version
0.0098sec    0.43    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 04:34 PM