We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,328 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

SQL - Select substring

Hello!
I need to write a query that selects TableID (a previously concatenated string) and also selects a substring of TableID as another column. All data in TableID is in the format %System.Variable, %Class.User, etc. I need to select from the % to the '.' to return something like %System and %Class respectively. Any suggestions?
Thanks!
Phil

1
Contributor
1
Reply
17 Minutes
Discussion Span
10 Months Ago
Last Updated
3
Views
Question
Answered
PhilEaton
Junior Poster
119 posts since Aug 2010
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 1

Got it working!
substring(TableId,1,charindex('.',TableId)-1) AS Package,

PhilEaton
Junior Poster
119 posts since Aug 2010
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 1
Question Self-Answered as of 10 Months Ago

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0531 seconds using 2.64MB