Recent content by Adamfm

  1. A

    Error on IIF

    Hi Mark, Yes I understand now, even though it was showing 1 and 0 they were text rather than numbers. I actually changed the table values from Yes/No to numbers which was the easiest thing for me. Thanks for the advice!
  2. A

    Error on IIF

    OK CJ brilliant that worked thanks, got there in the end! One small thing I tried to use the Rnd function to 2dp within the equation but it doesn't like it, can you advise please? PercentageFail: Sum(([Fail])/([Success])*100)
  3. A

    Error on IIF

    Hi CJ, "Successful" is Boolean so I have changed the table to number and now Yes=0 and No is -1, is that what you wanted me to do? So now will use IIf([Successful]=-1,"1","0") then will look at PercentUnsuccessful: Sum([Failed])/Sum([Boarded])*100 Thanks... Will let you know if I can get...
  4. A

    Error on IIF

    OK, So I understand now what the issue is in that Boarded and Failed need to be on the same row in order to calculate the average but at present they are on 2 separate rows (see attachment) which is why I'm getting the Zero value error. How do I get it so that the boarded and failed are on the...
  5. A

    Error on IIF

    Hi CJ, Sorry I have been away for a week. Coming back to the problem I took away the grouping and summing and used the following which worked fine Boarded: Abs(IIf([Successful]=-1,"1","0")) Failed: Abs(IIf([Successful]=0,"1","0")) Now trying to get the average which is what you mention in...
  6. A

    Error on IIF

    arelgp thanks but just cannot get that to work? I replaced Yes and No with 1 and 0 as you suggested, thanks. CJ tried your code SELECT Qry3TotalPaxBoarded0.Airline, Qry3TotalPaxBoarded0.Airport, Qry3TotalPaxBoarded0.Date, Qry3TotalPaxBoarded0.[Flight Number]...
  7. A

    Error on IIF

    Hi CJ, I was hoping this would change it to the boolean value Boarded: Sum(Abs(IIf([Successful]=-1,"1","0"))) and Failed: Sum(Abs(IIf([Successful]=0,"1","0"))) but I'm still getting #Div/0! on the following query?
  8. A

    Error on IIF

    OK, So I've got a sum attached Boarded and Failed image attached Then tried this: PercentUnsuccessful: (([Failed]/[Boarded])*100) Getting #Div/0! - does this have to do with it not being boolean?
  9. A

    Error on IIF

    Brilliant! That worked so now I have the two fields (took CJ's advice and removed the Yes) Boarded: IIf([Successful]=-1,"1","0") and Failed: IIf([Successful]=0,"1","0") So the next thing do is calculate the percentage of failures per flight, which I think I can do. Thanks very much!!!!
  10. A

    Error on IIF

    Hi, Trying to add a value of 1 if yes using the following but I'm getting an error in the field when I run the query? Can anyone help please? Yes: IIf([Successful]="Yes","1","0") Thanks in advance! Adam
  11. A

    Average based on criteria

    Hi, Sorry yes you are completely correct, not an average at all! Sorry was having a dumb day. What I actually mean is what percentage of the total number of passengers have failed to board. So that is where I get the formula from where out of 100 passengers 95 board and 5 don't therefore (5 /...
  12. A

    Average based on criteria

    Hi, Sorry new to this site and haven't touched Access for over 10 years! Have tried to search for an answer thought it maybe DAvg but can't get the syntax correct and keeps crashing my Db. Anyway I have a query which counts number of passengers either successful or not. Date | Flight No|...
Top Bottom