Derek O'Brien
07-22-2009, 05:49 AM
I'm hoping someone can help me with what I'm sure is a basic question.
I'm using Microsoft Access 2003, and I trying to create a query involving names and addresses. there is a separate field for the postcodes. There is a specific postcode which I need to amend using the query, but the two methods I've tried are less than perfect.
In the first instance, if I use:
Replace([Prof Inv].[Address Postcode],'OL16 5RX','OL16 5RS') AS Postcode
It does change the postcodes, leaves the others - but produces "#Error" in records where there was never any postcode listed.
In the second instance, if I use:
Iif([Prof Inv].[Address Postcode]='OL16 5RX','OL16 5RS') AS Postcode
It does change the postcodes, but wipes out all the others.
Where am I going wrong, please?
Many thanks in advance,
Derek
I'm using Microsoft Access 2003, and I trying to create a query involving names and addresses. there is a separate field for the postcodes. There is a specific postcode which I need to amend using the query, but the two methods I've tried are less than perfect.
In the first instance, if I use:
Replace([Prof Inv].[Address Postcode],'OL16 5RX','OL16 5RS') AS Postcode
It does change the postcodes, leaves the others - but produces "#Error" in records where there was never any postcode listed.
In the second instance, if I use:
Iif([Prof Inv].[Address Postcode]='OL16 5RX','OL16 5RS') AS Postcode
It does change the postcodes, but wipes out all the others.
Where am I going wrong, please?
Many thanks in advance,
Derek