Shortening a field. (1 Viewer)

New2SQL

Registered User.
Local time
Today, 03:48
Joined
Apr 15, 2005
Messages
19
I am looking for the best way to shortern a string. Basically the string has the set up like this:

New2SQL/123/London

I just want the name bit at the beginning. Everything before the first /

any one have an idea the best way to get this?

thanks
 

boblarson

Smeghead
Local time
Today, 03:48
Joined
Jan 12, 2001
Messages
32,059
Left$([YourFieldNameHere],Instr(1,[YourFieldNameHere],"/")-1)
 

New2SQL

Registered User.
Local time
Today, 03:48
Joined
Apr 15, 2005
Messages
19
dude you are a leg-end!

thanks a lot.
 

New2SQL

Registered User.
Local time
Today, 03:48
Joined
Apr 15, 2005
Messages
19
actually...

I have also tried this in SQL Query Analyzer (same database) but InStr isn't valid?

any alternatives in SQL QA?
 

boblarson

Smeghead
Local time
Today, 03:48
Joined
Jan 12, 2001
Messages
32,059
ah, important piece of info you probably should have shared up front. I was assuming you were talking Access queries (primarily since this is an Access forum, but we do have a SQL Server category below). I'm not familiar enough with SQL to give you that. Perhaps one of our other community members would be able to help.
 

Users who are viewing this thread

Top Bottom