reens80
12-19-2007, 03:12 AM
Hi All,
Hope you can help, it’s been a while since I have used Access, and I am using 2007.
I am trying to split out Postcodes to remove the last 2 characters, i.e.
LE12 6YU becomes LE12 6 (NewPostCode)
LE5 8YU becomes LE5 8
I set up my query in data set view and then I switch over to SQL view, this is what I have
================================================== ===
SELECT Sample.Postcode, split([Postcode], RIGHT(postcode, 2))(0) AS NewPostCode
FROM Sample;
================================================== ====
When doing this query I get an error saying invalid syntax and it reads the (0) as (0. Or something
Much appreciated,
Hope you can help, it’s been a while since I have used Access, and I am using 2007.
I am trying to split out Postcodes to remove the last 2 characters, i.e.
LE12 6YU becomes LE12 6 (NewPostCode)
LE5 8YU becomes LE5 8
I set up my query in data set view and then I switch over to SQL view, this is what I have
================================================== ===
SELECT Sample.Postcode, split([Postcode], RIGHT(postcode, 2))(0) AS NewPostCode
FROM Sample;
================================================== ====
When doing this query I get an error saying invalid syntax and it reads the (0) as (0. Or something
Much appreciated,