This discussion is closed.
Alex H
Badges: 0
#1
Report Thread starter 17 years ago
#1
Hi

Im trying to have an If formula for multiple things in it for my as level ICT coursework and having trouble

This is what I've got and its not working!

Expr1: IIf([No Fine Practice]![Days Overdue]<7,"0.00"+IIf([No Fine Practice]![Days Overdue]>6<15,"0.30"))

The first bit is fine with all number less than 7 returning the value 0.00

The problem is with the second bit as its meant to be more than 6 and less than 15 to returrn 0.30

This is where it goes horribly wrong because when I run the query it finishes with 0.000.30 on the parts that were originally 0.00

Do I have to do separate queries each time?

Thanks for your help in advance

Alex
0
VLadwa
Badges: 0
#2
Report 17 years ago
#2
Its All Wrong!
0
PQ
Badges: 21
Rep:
?
#3
Report 17 years ago
#3
(Original post by Alex H)
Expr1: IIf([No Fine Practice]![Days Overdue]<7,"0.00"+IIf([No Fine Practice]![Days Overdue]>6<15,"0.30"))

The first bit is fine with all number less than 7 returning the value 0.00

The problem is with the second bit as its meant to be more than 6 and less than 15 to returrn 0.30

This is where it goes horribly wrong because when I run the query it finishes with 0.000.30 on the parts that were originally 0.00
Try rephrasing it in the format
if(expr, 0.00, if((expr and expr),0.30,ERROR))

ie
IIf([No Fine Practice]![Days Overdue]<7,"0.00",((IIf([No Fine Practice]![Days Overdue]>6 and IIf([No Fine Practice]![Days Overdue]<15),"0.30","ERROR"))
0
Camford
Badges: 12
Rep:
?
#4
Report 17 years ago
#4
to the best of my knowledge iif uses three parameters. Something in the query? if not, use VBA. A lot clearer than expressions.
0
X
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

What support do you need with your UCAS application?

I need help researching unis (20)
14.29%
I need help researching courses (8)
5.71%
I need help with filling out the application form (7)
5%
I need help with my personal statement (57)
40.71%
I need help with understanding how to make my application stand out (35)
25%
I need help with something else (let us know in the thread!) (3)
2.14%
I'm feeling confident about my application and don't need any help at the moment (10)
7.14%

Watched Threads

View All