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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting Access command line to SQL 1

Status
Not open for further replies.

smuthcrmnl777

Technical User
Jan 16, 2006
104
US
In MS Access, I can create this command line.

Right([Product name],InStr([Product name],',')+3)

Is there a way to reproduce this in SQL?

 
Code:
RIGHT([Product name],CHARINDEX(';',[Product name])+3)
(not tested)

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
I also have to do this...


Right([Product name],InStr([Product name],'COM')+3)


How do I go about doing this?
 
The same.
CHARINDEX:
Returns the starting position of the specified expression in a character string.

Code:
RIGHT([Product name],CHARINDEX('COM',[Product name])+3)


Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top