Help with Date Ranges

J

jen-chi

I'm trying to show "within TRTW" or "Not TRTW" using fields already in my
query. This is what I have been trying but I get the following error "You
must enclose IIF function arguements in Parentheses"

Status Within TRTW?: (IIF[Time Tracking]![Benefit Begin Date] Between [TRTW
- Scorecard]![Date entered TRTW?], And [TRTW - Scorecard]![Date Released from
TRTW?], "Within TRTW", "Not TRTW")

Please help.....
 
C

Clifford Bass

Hi jen-chi,

I think you have a couple extraneous characters in that. Remove the
leading ( and the first , and it should be okay.

Clifford Bass
 
F

fredg

I'm trying to show "within TRTW" or "Not TRTW" using fields already in my
query. This is what I have been trying but I get the following error "You
must enclose IIF function arguements in Parentheses"

Status Within TRTW?: (IIF[Time Tracking]![Benefit Begin Date] Between [TRTW
- Scorecard]![Date entered TRTW?], And [TRTW - Scorecard]![Date Released from
TRTW?], "Within TRTW", "Not TRTW")

Please help.....

That is correct. You must enclose the function arguments within
parenthesis.
The correct syntax for a function is
FunctionName(arguments)

Look at your code again.
You placed the opening parenthesis outside the IIf
(IIf [Time ..... etc.

It should be inside, surrounding the arguments:

Status Within TRTW?:IIF([Time Tracking]! .... etc....
 
C

Clifford Bass

Hi Fred,

Good catch. I missed that he had it reversed. However, he still needs
to remove the first comma.

Clifford Bass

fredg said:
I'm trying to show "within TRTW" or "Not TRTW" using fields already in my
query. This is what I have been trying but I get the following error "You
must enclose IIF function arguements in Parentheses"

Status Within TRTW?: (IIF[Time Tracking]![Benefit Begin Date] Between [TRTW
- Scorecard]![Date entered TRTW?], And [TRTW - Scorecard]![Date Released from
TRTW?], "Within TRTW", "Not TRTW")

Please help.....

That is correct. You must enclose the function arguments within
parenthesis.
The correct syntax for a function is
FunctionName(arguments)

Look at your code again.
You placed the opening parenthesis outside the IIf
(IIf [Time ..... etc.

It should be inside, surrounding the arguments:

Status Within TRTW?:IIF([Time Tracking]! .... etc....
 

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

Top