Confused about text criteria

  • Thread starter Thread starter Sheila D
  • Start date Start date
S

Sheila D

Can anybody tell me why this works:

WHERE
(((Q_Procedure_Type_Strings.Combined)=[Forms]![ChooseF_Consultant_Procedure_Times]![Combined]))
OR ((([Forms]![ChooseF_Consultant_Procedure_Times]![Combined]) Is Null));

but this does not

WHERE (((Q_Procedure_Type_Strings.Combined) Like
IIf([Forms]![ChooseF_Consultant_Procedure_Times]![Combined] Is
Null,"*",[Forms]![ChooseF_Consultant_Procedure_Times]![Combined])));

I have other text criteria expressed with the Like IIF which work perfectly
so I'm puzzled! ANy help much appreciated.
Sheila
 
Sheila said:
Can anybody tell me why this works:

WHERE
(((Q_Procedure_Type_Strings.Combined)=[Forms]![ChooseF_Consultant_Procedure_Times]![Combined]))
OR ((([Forms]![ChooseF_Consultant_Procedure_Times]![Combined]) Is Null));

but this does not

WHERE (((Q_Procedure_Type_Strings.Combined) Like
IIf([Forms]![ChooseF_Consultant_Procedure_Times]![Combined] Is
Null,"*",[Forms]![ChooseF_Consultant_Procedure_Times]![Combined])));

I have other text criteria expressed with the Like IIF which work perfectly
so I'm puzzled! ANy help much appreciated.


The second only works under a bunch of restrictions
(wildcards). The first one is much more explicit without
the confusion of using Like.
 
You don't tell us why you think your second syntax doesn't work. Your issue
might be that a criteria of:
Like "*"
will not match Nulls in your field.
 

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