Please help with Query Criteria

P

Please Help

Hello all,

I have a number field in my append query. Instead of hard coated the
criteria with the formula "<>0" on that field, I want to make it to prompt
the user for a value when the query is ran. I tried the formula:

Not Like nz([Please enter a value for exclusion],"*")

That formula does not seem to work.

Please help.

Thanks.
 
J

John W. Vinson/MVP

Please Help said:
Hello all,

I have a number field in my append query. Instead of hard coated the
criteria with the formula "<>0" on that field, I want to make it to prompt
the user for a value when the query is ran. I tried the formula:

Not Like nz([Please enter a value for exclusion],"*")

That formula does not seem to work.

The LIKE operator is intended for partial matches using string values. It
can give peculiar results with numbers and should generally not be used.

All you need is

<> [Please enter a value to be excluded:]
 
P

Please Help

Hi John,

Thanks for your response.

In addition to make the criteria to prompt the user for a value, I also want
to make that criteria an optional criteria, which means users do not have to
enter a value and query then would show all the records. I thought my
formula would work.

Please help. Also can you help me with the post that I posted yesterday
with the post name "Please help me with my query"?

Thanks.

John W. Vinson/MVP said:
Please Help said:
Hello all,

I have a number field in my append query. Instead of hard coated the
criteria with the formula "<>0" on that field, I want to make it to prompt
the user for a value when the query is ran. I tried the formula:

Not Like nz([Please enter a value for exclusion],"*")

That formula does not seem to work.

The LIKE operator is intended for partial matches using string values. It
can give peculiar results with numbers and should generally not be used.

All you need is

<> [Please enter a value to be excluded:]
 
J

John W. Vinson/MVP

Please Help said:
Hi John,

Thanks for your response.

In addition to make the criteria to prompt the user for a value, I also
want
to make that criteria an optional criteria, which means users do not have
to
enter a value and query then would show all the records. I thought my
formula would work.


This should do it:

<> [Please enter a value to be excluded:] OR [Please enter a value to be
excluded:] IS NULL

Please help. Also can you help me with the post that I posted yesterday
with the post name "Please help me with my query"?

I'll try to find the thread.
Thanks.

John W. Vinson/MVP said:
Please Help said:
Hello all,

I have a number field in my append query. Instead of hard coated the
criteria with the formula "<>0" on that field, I want to make it to
prompt
the user for a value when the query is ran. I tried the formula:

Not Like nz([Please enter a value for exclusion],"*")

That formula does not seem to work.

The LIKE operator is intended for partial matches using string values. It
can give peculiar results with numbers and should generally not be used.

All you need is

<> [Please enter a value to be excluded:]
 
P

Please Help

Good morning John,

Thank you very much for your help and your consideration on my other tread.

I am pulling my hairs on how to do on my other tread.

Thanks.

John W. Vinson/MVP said:
Please Help said:
Hi John,

Thanks for your response.

In addition to make the criteria to prompt the user for a value, I also
want
to make that criteria an optional criteria, which means users do not have
to
enter a value and query then would show all the records. I thought my
formula would work.


This should do it:

<> [Please enter a value to be excluded:] OR [Please enter a value to be
excluded:] IS NULL

Please help. Also can you help me with the post that I posted yesterday
with the post name "Please help me with my query"?

I'll try to find the thread.
Thanks.

John W. Vinson/MVP said:
Hello all,

I have a number field in my append query. Instead of hard coated the
criteria with the formula "<>0" on that field, I want to make it to
prompt
the user for a value when the query is ran. I tried the formula:

Not Like nz([Please enter a value for exclusion],"*")

That formula does not seem to work.

The LIKE operator is intended for partial matches using string values. It
can give peculiar results with numbers and should generally not be used.

All you need is

<> [Please enter a value to be excluded:]
 

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