im trying make no matter how long postcode has space before last 3 characters. receive postcodes , people have typed in 4 characters code :
update [datatool].[dbo].[eh10414 summer events] set postcode = case when len(postcode) = 6 stuff(postcode, 4, 0, ' ') when len(postcode) = 7 stuff(postcode, 5, 0, ' ') end charindex(' ', postcode, 1) = 0 , len(postcode) between 6 , 7 isnt use. got of site work not im looking for. im pretty new sql in access can use this:
update to: left([postcode],len([postcode])-3) & " " & right([postcode],3)
this works dont know how implement sql.
any great :)
your access code pretty work in sql server:
left(postcode, len(postcode) - 3) + ' ' + right(postcode, 3) i check first space not there:
(case when postcode '% ___' postcode else left(postcode, len(postcode) - 3) + ' ' + right(postcode, 3) end)
Comments
Post a Comment