Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting a Query from SQL Sever to Access 1

Status
Not open for further replies.

DrSeussFreak

Programmer
Feb 16, 2007
149
US
Code:
 SELECT Right([Last Name], CharIndex(' ', Reverse([Last Name]) + ' ') - 1) [Last Name], from contacts

This is code written for SQL Sever, but I am not sure of how to make it work in Access. Any ideas?
 
Code:
CharIndex(' ', Reverse([Last Name]) + ' ')

should be replaced with
Code:
InStrRev([Last Name], ' ')

You also should look at the regular InStr function, if you are going to be converting a lot of queries from SQL Server, as this is the replacement for the standard Charindex.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top