hbrady
asked on
Select records based on character count to the left and right of a given character
I need to return material_id and material_descrip from a table called mmaster based on selection criteria of data in a column called user_1.
I need to select records where the vale in user_1 contains a ‘-‘ AND the count of characters to the left of the ‘-‘ = 5 AND the count of the characters to the right of ‘-‘ =2.
Thanks in advance!
I need to select records where the vale in user_1 contains a ‘-‘ AND the count of characters to the left of the ‘-‘ = 5 AND the count of the characters to the right of ‘-‘ =2.
Thanks in advance!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Two good solutions, one simple, one a bit more complex. I actually ran the simple one and it gave me what I needed; however, it picked up a few records which contained multiple hyphens. Easy enough to omit but were this a large data set I would have gone with the more complex solution. Thank you both!
http://technet.microsoft.com/en-us/library/ms174473.aspx