Results 1 to 2 of 2

Thread: IIf code

  1. #1
    Join Date
    Mar 2004
    Posts
    79

    Unanswered: IIf code

    Please help.
    I had the following code and it workded great.

    =Sum(IIf([Type]='1',IIf([MinMax]="MIN",[Rate],IIf([MinMax]="MAX",[Rate],IIf([Tier]="Y",Round(([TierWgt]*[Rate]),2),Round(([WgtHrs]*[Rate]),2)))),IIf([Type]='2',Round(([WgtHrs]*[Rate]),2),IIf([Type]='3',Round(([WgtHrs]*[Rate]),2),0))))

    Now I'm trying to add another condition and I keep getting #ERROR.

    =Sum(IIf([Type]='1',IIf([MinMax]="MIN",[Rate],IIf([MinMax]="MAX",[Rate],IIf([Tier]="Y",Round(([TierWgt]*[Rate]),2),IIf([InvDate]>"10/07/06",Round([Rate],2),Round(([WgtHrs]*[Rate]),2))))),IIf([Type]='2',Round(([WgtHrs]*[Rate]),2),IIf([Type]='3',Round(([WgtHrs]*[Rate]),2),0))))

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    try changing IIf([InvDate]>"10/07/06" to IIf([InvDate]>#10/07/06#
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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