DECLARE @st_Spaces char(25) DECLARE @st_NoSpaces char(25)...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers Meta

Q&A about the site for Drupal developers and administrators

-- Enter Query Title
-- Enter Query Description
DECLARE @st_Spaces char(25)
DECLARE @st_NoSpaces char(25)

SET @st_Spaces = '123 56'  --One space, pos 4
SET @st_NoSpaces = REPLACE(@st_Spaces, ' ', '4') --Replace space w/ 4


SELECT LEN(LEFT(@st_Spaces, 4)), --Returns 3
LEN(LEFT(@st_NoSpaces,4)) --Returns 4

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results