SQL Statement Problem

B

bw

The following SQL Statement prompts for me to "Enter Parameter Value"
for InstallDate, and I can't figure out why.
If I leave out the Criteria, then it works fine.
Can someone explain?

Field: InstallDate:
IIf([Forms]![boxSeats]![PrintWhich]=4,[TInstDate],[PInstDate])
Criteria: Is Not Null And IIf([Forms]![boxSeats]![PrintOneOrAll]="All
Dates",[InstallDate])

Thanks,
Bernie
 
S

Stefan Hoffmann

hi Bernie,
Field: InstallDate:
IIf([Forms]![boxSeats]![PrintWhich]=4,[TInstDate],[PInstDate])
Criteria: Is Not Null And IIf([Forms]![boxSeats]![PrintOneOrAll]="All
Dates",[InstallDate])
You cannot reference InstallDate in the criteria. And your Iif is not
complete nor see i any reason for it to be in the criteria.


mfG
--> stefan <--
 
B

bw

Thanks for the reply Stefan.

"And your Iif is not complete nor see i any reason for it to be in the
criteria."
What is "lif"?

So where do I reference InstallDate?

Bernie

Stefan Hoffmann said:
hi Bernie,
Field: InstallDate:
IIf([Forms]![boxSeats]![PrintWhich]=4,[TInstDate],[PInstDate])
Criteria: Is Not Null And IIf([Forms]![boxSeats]![PrintOneOrAll]="All
Dates",[InstallDate])
You cannot reference InstallDate in the criteria. And your Iif is not
complete nor see i any reason for it to be in the criteria.


mfG
--> stefan <--
 
S

Stefan Hoffmann

hi Bernie,
"And your Iif is not complete nor see i any reason for it to be in the
criteria." What is "lif"?
From your op:

Criteria: Is Not Null And IIf([Forms]![boxSeats]![PrintOneOrAll]="All
Dates",[InstallDate])

This IIf() is not complete, the FalsePart is missing:

Function IIf(Expression, TruePart, FalsePart)
Element of VBA.Interaction
So where do I reference InstallDate?
The easiest way: save your query without criterias. Use this query to
build a second one with the criterias.


mfG
--> stefan <--
 
B

bw

Ohhhhhh, IIF !

I'm sorry I didn't pick up on that.

I'll try to build a second criteria.
Thanks for your help.
Bernie

Stefan Hoffmann said:
hi Bernie,
"And your Iif is not complete nor see i any reason for it to be in
the criteria." What is "lif"?
From your op:

Criteria: Is Not Null And IIf([Forms]![boxSeats]![PrintOneOrAll]="All
Dates",[InstallDate])

This IIf() is not complete, the FalsePart is missing:

Function IIf(Expression, TruePart, FalsePart)
Element of VBA.Interaction
So where do I reference InstallDate?
The easiest way: save your query without criterias. Use this query to
build a second one with the criterias.


mfG
--> stefan <--
 

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