This discussion is closed.
Alex H
Badges: 0
#1
Report Thread starter 16 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 16 years ago
#2
Its All Wrong!
0
PQ
Badges: 21
Rep:
?
#3
Report 16 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 16 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

If you do not get the A-level grades you want this summer, what is your likely next step?

Take autumn exams (207)
47.05%
Take exams next summer (63)
14.32%
Change uni choice through clearing (99)
22.5%
Apply to uni next year instead (45)
10.23%
I'm not applying to university (26)
5.91%

Watched Threads

View All