I have a query with 5 possible criteria via a form. If criteria is
not entered, I use the like Nz() function on the backend query to use
an "*" for criteria fields left blank. The query is not returning the
full recordset. If the Like Nz() function is used on 1 field, it
returns the correct number of records. As soon as I add it on more
then one field, it loses records somehow. ???
For example,
SELECT [Glossary].GlossaryID, [Glossary].CoordinatorName,
[Glossary].Status, [Glossary].MaintenanceCategory
FROM [Glossary]
WHERE ((([Glossary].CoordinatorName) Like
Nz(Forms!JenSelection!Coordinator,"*"));
This returns the correct number of fields using the function on one
field.
This below does not:
SELECT [Glossary].GlossaryTermID, [Glossary].CoordinatorName,
[Glossary].Status, [Glossary].MaintenanceCategory
FROM [Glossary]
WHERE (([Glossary].CoordinatorName) Like
Nz(Forms!JenSelection!Coordinator,"*")) And (([Glossary].Status) Like
Nz(Forms!JenSelection!Status,"*")) And
(([Glossary].MaintenanceCategory) Like
Nz(Forms!JenSelection!MaintenanceCategory"*")); 2 2580
Jennifer wrote: I have a query with 5 possible criteria via a form. If criteria is not entered, I use the like Nz() function on the backend query to use an "*" for criteria fields left blank. The query is not returning the full recordset. If the Like Nz() function is used on 1 field, it returns the correct number of records. As soon as I add it on more then one field, it loses records somehow. ???
For example, SELECT [Glossary].GlossaryID, [Glossary].CoordinatorName, [Glossary].Status, [Glossary].MaintenanceCategory FROM [Glossary] WHERE ((([Glossary].CoordinatorName) Like Nz(Forms!JenSelection!Coordinator,"*"));
This returns the correct number of fields using the function on one field.
This below does not: SELECT [Glossary].GlossaryTermID, [Glossary].CoordinatorName, [Glossary].Status, [Glossary].MaintenanceCategory FROM [Glossary] WHERE (([Glossary].CoordinatorName) Like Nz(Forms!JenSelection!Coordinator,"*")) And (([Glossary].Status) Like Nz(Forms!JenSelection!Status,"*")) And (([Glossary].MaintenanceCategory) Like Nz(Forms!JenSelection!MaintenanceCategory"*"));
So you are looking for all records where the coordinator name is null
and a status that is null and a maintenace category that is null. I
would expect your query is returning all records where those conditions
are true. Isn't that what you asked for?
Try the setting up your query using OR rather than AND
"Jennifer" <je***************@fmglobal.com> wrote in message
news:e3**************************@posting.google.c om... I have a query with 5 possible criteria via a form. If criteria is not entered, I use the like Nz() function on the backend query to use an "*" for criteria fields left blank. The query is not returning the full recordset. If the Like Nz() function is used on 1 field, it returns the correct number of records. As soon as I add it on more then one field, it loses records somehow. ???
For example, SELECT [Glossary].GlossaryID, [Glossary].CoordinatorName, [Glossary].Status, [Glossary].MaintenanceCategory FROM [Glossary] WHERE ((([Glossary].CoordinatorName) Like Nz(Forms!JenSelection!Coordinator,"*"));
This returns the correct number of fields using the function on one field.
This below does not: SELECT [Glossary].GlossaryTermID, [Glossary].CoordinatorName, [Glossary].Status, [Glossary].MaintenanceCategory FROM [Glossary] WHERE (([Glossary].CoordinatorName) Like Nz(Forms!JenSelection!Coordinator,"*")) And (([Glossary].Status) Like Nz(Forms!JenSelection!Status,"*")) And (([Glossary].MaintenanceCategory) Like Nz(Forms!JenSelection!MaintenanceCategory"*")); This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Skully Matjas |
last post by:
I am using the following code (created by the wizard) to
allow to bring my form to a particular entery. But when I
edit the entery (ex: put new information into a blank
cell), it puts that record...
|
by: Stewart Allen |
last post by:
I'm trying to filter a table that has 2 date fields, the first date will
always have a value but the second will only occasionally has a value. Each
date field also has a corresponding text field...
|
by: Jennifer |
last post by:
I have a query with 5 possible criteria via a form. If criteria is
not entered, I use the like Nz() function on the backend query to use
an "*" for criteria fields left blank. The query is not...
|
by: James Fortune |
last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't
understand why people who know how to write code to completely replace
a front end do not write something that will automate...
|
by: carrionk |
last post by:
Hi,
I'm running an ADO Recorset from Excel to gather data from Access.
Basically it's copying the records of a query -that runs without
problem in Access-
That query has an expression with NZ()...
| |
by: lylefair |
last post by:
The file is now available as
http://www.ffdba.com/downloads/testingNZ3.dat
(rename .dat to .mdb)
or
http://www.ffdba.com/downloads/testingNZ3.mdb
(At time of posting I have not opened the file.)
|
by: Lyle Fairfield |
last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/html/acfctNZ_HV05186465.asp
"If the value of the variant argument is Null, the Nz function returns
the number zero or a...
|
by: roz |
last post by:
Hello,
I'm fairly new to VB programming and I've been going round the bend
with this problem, so any nudges or shoves in the right direction would
be greatly appreciated.
I have a template...
|
by: Will |
last post by:
Hi,
I need to handle blank values in a query calculation. I have 636
records at the moment but when I sum over these records the blank
fields are not returned. I have looked around here and on...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |