Syntax error: Extra) in query expression

na

  • na

    Votes: 1 33.3%
  • na

    Votes: 0 0.0%
  • na

    Votes: 1 33.3%
  • na

    Votes: 1 33.3%

  • Total voters
    3
  • Poll closed .

GOVMATE

Registered User.
Local time
Today, 12:34
Joined
Aug 10, 2007
Messages
71
Hello I'm having trouble getting my nested Iif statement to run. Can anyone help??? I've attached a screen shot of the syntax error that I'm receiving. The example code below needs tweaking.



Update [Goodrec-copy3] set [Goodrec-copy3].shortname = Iif (Not Null([shortname]),[Goodrec-copy3].shortname Like "*,JR*" Or ([Goodrec-copy3].[shortname] Like "*, SR*" Or ([Goodrec-copy3].[shortname]) Like "*, II*" Or [Goodrec-copy3].[shortname]) Like "*, III*", InStrRev([shortname])," ",InStr([shortname]," ,")+1,50) &" "& Left([shortname],InStrRev([shortname])," ,")-1) WHERE ((([Goodrec-copy3].[ctype])="I"));

What I'm attempting to accomplish with this query is to keep the field shortname the same if not null and if it doesn't meet the criteria of having a string value of "JR", "SR", "II", or "III". If the field does have a string value of "JR", "SR", "II", or "III" reverse the string (example John Gissom JR) to reflect shortname as such for example: "Gissom JR John".

Thanks in advance!
 
Seem 'na' was most likely. All other things being equal - :)
 

Users who are viewing this thread

Back
Top Bottom