F
Fred Bloggs
Now I've tried creating a new table called 'Nametest' and a new query using
exactly the same parameters, and it gives the error message:
Extra ) in query expression
'Nametest.IIf(IsNull([Title]),IIf(InStr([Firstnames],"
I'm losing it!
James
exactly the same parameters, and it gives the error message:
Extra ) in query expression
'Nametest.IIf(IsNull([Title]),IIf(InStr([Firstnames],"
")=0,[Firstnames],Left([Firstnames],InStr([Firstnames]," ")-1)),[Title] &
"
" & [Surname]).
I'm losing it!
James
I have a database query using three fields from a Table: Title (Mr, Mrs,
Miss, etc), Firstnames (Michael David, or just Michael, etc) and Surname.
I've produced a query which, if there is data in Title, selects the Title,
then a space, then the first name of Firstnames, then a space, then the
Surname. If the Title is missing, it should use just the first name of the
Firstnames.
The expression I've used is:
Titletest: IIf(IsNull([Title]),IIf(InStr([Firstnames],"
")=0,[Firstnames],Left([Firstnames],InStr([Firstnames]," ")-1)),[Title] &
"
" & [Surname])
When I try to run this, it comes up with the error message: 'Undefined
function 'Left' in expression.
But if I create a new test database, make a table with just those three
fields create a query and use exactly the same expression, it works
perfectly.
The table in the existing database seems fine, there is no syntax error on
fieldnames, etc. Even if I copy the query across from the test database,
it
still comes up with the same error message.
What is going on here? What am I doing wrong?
Cheers
James
PS Using MS Access 2003 SP2