From: Mo on
On 13/04/2010 14:10, John Spencer wrote:
> FirstPart:
> IIF([NHS Number new/old] LIKE "### ### ####*",LEFT([NHS Number
> new/old],12), Null)
>
> SecondPart:
> More complex since you need to test for two conditions
> IIF([NHS Number new/old] Like "*/*"
> , Trim(Mid([NHS Number new/old],Instr(1,[NHS Number new/old],"/")+1)),
> IIF([NHS Number new/old] NOT LIKE "### ### ####", [NHS Number
> new/old],Null))
>
> This does make the assumption that the NEW NHS number always has the
> format nnn nnn nnnn.
>

Thanks very much John. I'll try that.