Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Invalid syntax (Access 2000)

    I get the error invalid syntax for the following line : ( summing up figures in case GetBonus = Yes)

    Bonus : iif(getBonus = -1;nz(BonusL1;0)+ NZ([BonusL2];0)+ NZ([BonusL3];0)

    could you help ?

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Invalid syntax (Access 2000)

    I am assuming you are doing this in a query and not code. Try this:

    iif ([getbonus] = -1, Nz([BonusL1],0) + Nz([BonulL2],0) + Nz([BonulL3],0))

    HTH
    Regards,

    Gary
    (It's been a while!)

  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Invalid syntax (Access 2000)

    Thank you for your reply.I had to convert the commas into semocolon for the european countries.This time i get a compile error :
    Expr1: IIf([getbonus]=-1;Nz([BonusL1];0)+Nz([BonulL2];0)+Nz([BonulL3];0))

    Could you help me further ? I am at a complete loss

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Invalid syntax (Access 2000)

    The iif instruction has 3 arguments.

    You say it results i a compile error, is this code in VBA?

    If that doesn't solve your problem post a compacted zipped version of your database.

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Invalid syntax (Access 2000)

    I think this line is just missing one bracket and the third part of the if

    Bonus : iif(getBonus = -1;nz(BonusL1;0)+ NZ([BonusL2];0)+ NZ([BonusL3];0)<font color=red>;0)</font color=red>

    [i] corrected error in first post
    Regards
    John



  6. #6
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Invalid syntax (Access 2000)

    Now it works ! I am so grateful to you all for your attention and for your help. Now i have the query working and i thank you to yo all

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •