Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    3

    Unanswered: IIF formula not working (was "Probably a simple problem")

    Hi, If is this a simple problem, I'm sorry but desperate for help! - I'm grateful for any replies thankyou

    Right - I'm a student using access 2000, trying to get this pratical done about a Hall's bookings. I've made a query on which I have based a report. The report is to list the monthly takings for a month, based on the 'slots' that are booked. The idea is for 18th Birthday parties and Gold or Silver Weddings the Hall can be rented for a special flat rate of 10 instead of the standard price.

    The price of the slots vary - I have a field name 'SlotPrice' in which contains a fixed amount (not a calculated field).

    I have a field called Total Cost that is supposed to detect what is in the 'Title Event' field and if it matches the 18th Birthday Parties, Golden or Silver Weddings it puts the 10 charge, otherwise it should charge what is in the 'SlotPrice' field.

    I have this formula so far written in a query - I'm not so sure how to add in if the title is not any of the mentioned to tell it to display whats in the 'SlotPrice' field:

    Total Cost: IIf([Title Event] In ("Golden wedding","18th Birthday","Silver Wedding"),10)

    This doesn't seem to even work on its own! Thanks in advance for any help.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    IIf([Title Event] In ("Golden wedding","18th Birthday","Silver Wedding"),10,SlotPrice )
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You would benefit from storing event types in a seperate table, then setting rates from there...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    May 2006
    Posts
    3
    Thankyou very much for the replies- formula works brilliantly r937. Might try storing the other variables in another table once I have input more data

Posting Permissions

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