Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 convert access query to sql

Author  Topic 

smorty44
Yak Posting Veteran

93 Posts

Posted - 2007-08-17 : 12:12:16
I am being asked to convert this access query into sql server 2000.
Access query
SELECT Left(Trim([Notes_Primary_Key]),InStr(Trim([Notes_Primary_Key])," ")) AS PcnPID, Trim([Notes_Secondary_Key]) AS PcnTicketNum
FROM tri_offnotes;

I'm new to SQL and am not familiar with which function replaces the InStr access function.

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2007-08-17 : 12:29:14
InStr(Trim([Notes_Primary_Key])," ") =

CHARINDEX(' ',LTrim(RTrim([Notes_Primary_Key])))

Jim
Go to Top of Page

smorty44
Yak Posting Veteran

93 Posts

Posted - 2007-08-17 : 12:52:16
Thank you jimf
Go to Top of Page
   

- Advertisement -