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
 Excel formula to SQL

Author  Topic 

goodguy
Starting Member

3 Posts

Posted - 2011-09-02 : 14:15:33
=MID(U84,FIND(":",U84,FIND("ID",U84,1))+2,(FIND("-",U84,FIND("ID",U84,1))-FIND(":",U84,FIND("ID",U84,1)))-3)

What SQL Syntax should I use to replace this Excel formula?

This formula finds a place in a log and produces the next 10 charaters.(basicaly)

Thanks

I am clueless

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-02 : 20:39:34
in sql server you can use following
CHARINDEX instead of FIND and SUBSTRING instead of MID

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

goodguy
Starting Member

3 Posts

Posted - 2011-09-03 : 07:11:40
Thanks for the direction. BTW is their someplace where I can find this information in the future that is a good resource.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-03 : 12:43:20
http://msdn.microsoft.com/en-us/library/ms186323.aspx

http://msdn.microsoft.com/en-us/library/ms187748.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

goodguy
Starting Member

3 Posts

Posted - 2011-09-06 : 10:43:52
I know I am a little late, but thank you, that is what I needed to pull this off.

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-06 : 11:07:37
np
you're welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -