Help with IIf in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Please bare with me as I am somewhat new to Access. I am trying to set up an
IIf expression in a query and it is not returning any results. I am trying to
calculate the amount of overtime for my department. The overtime is based on
the amount of open items that are more than 20 days old. I already have a
table set up to pull those items. I have set up a quick table to just count
the amount of open items that are more than 20 days old, but when I create a
query with an IIf expression in the criteria field no results are given.
Below is my expression.

IIf([Friday Over Time Count]![CountOfOPENITEM_SEQ_NBR]>351,15,IIf([Friday
Over Time Count]![CountOfOPENITEM_SEQ_NBR]>301,10,IIf([Friday Over Time
Count]![CountOfOPENITEM_SEQ_NBR]>251,8,IIf([Friday Over Time
Count]![CountOfOPENITEM_SEQ_NBR]>201,5,IIf([Friday Over Time
Count]![CountOfOPENITEM_SEQ_NBR]>151,4,IIf([Friday Over Time
Count]![CountOfOPENITEM_SEQ_NBR]>101,2,No))))))

What am I doing wrong? Am I going about this the wrong way (would not
suprise me)?

Any and all help would be greatly appreciated. Let me know if I am not
making any sense at all and I will try to explain it in a different way.

Thanks,

Josh
 
This IIF expression is not criteria.
In design view create a new output field in the grid like this --
Overtime: IIf([Friday Over Time
Count]![CountOfOPENITEM_SEQ_NBR]>351,15,IIf([Friday ......
 
That worked perfectly. I feel dumb now.

Thanks for your help.

KARL DEWEY said:
This IIF expression is not criteria.
In design view create a new output field in the grid like this --
Overtime: IIf([Friday Over Time
Count]![CountOfOPENITEM_SEQ_NBR]>351,15,IIf([Friday ......

--
KARL DEWEY
Build a little - Test a little


Josh said:
Hello,

Please bare with me as I am somewhat new to Access. I am trying to set up an
IIf expression in a query and it is not returning any results. I am trying to
calculate the amount of overtime for my department. The overtime is based on
the amount of open items that are more than 20 days old. I already have a
table set up to pull those items. I have set up a quick table to just count
the amount of open items that are more than 20 days old, but when I create a
query with an IIf expression in the criteria field no results are given.
Below is my expression.

IIf([Friday Over Time Count]![CountOfOPENITEM_SEQ_NBR]>351,15,IIf([Friday
Over Time Count]![CountOfOPENITEM_SEQ_NBR]>301,10,IIf([Friday Over Time
Count]![CountOfOPENITEM_SEQ_NBR]>251,8,IIf([Friday Over Time
Count]![CountOfOPENITEM_SEQ_NBR]>201,5,IIf([Friday Over Time
Count]![CountOfOPENITEM_SEQ_NBR]>151,4,IIf([Friday Over Time
Count]![CountOfOPENITEM_SEQ_NBR]>101,2,No))))))

What am I doing wrong? Am I going about this the wrong way (would not
suprise me)?

Any and all help would be greatly appreciated. Let me know if I am not
making any sense at all and I will try to explain it in a different way.

Thanks,

Josh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top