I need to be able to determine if the last 7 characters of a string is equal to " WHERE ". How do I do this?
Mike
I need to be able to determine if the last 7 characters of a string is equal to " WHERE ". How do I do this?
Mike

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
<code>
If Right(strMyString,7) = "Where" Then
</code>
Legare Coleman
You can use Right(expression,7) to return the last 7 characters of expression
If you tell us how you want to use this, we may be able to offer more specific help.
that is exactly what I wanted. I am just using this to determine what comes next in an SQL statement. The only question I have would be will this function pick up the spaces in " WHERE " before and after the word?
Thanks
Yes, as Hans and I wrote it, it will pick up the last seven characters whatever they are. If you don't want the trailing space, then you could use something like:
<code>
Right(Trim(strMyString),7)
</code>
Legare Coleman
That worked great.
Thanks