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].CoordinatorNam e,
[Glossary].Status, [Glossary].MaintenanceCat egory
FROM [Glossary]
WHERE ((([Glossary].CoordinatorNam e) Like
Nz(Forms!JenSel ection!Coordina tor,"*"));
This returns the correct number of fields using the function on one
field.
This below does not:
SELECT [Glossary].GlossaryTermID , [Glossary].CoordinatorNam e,
[Glossary].Status, [Glossary].MaintenanceCat egory
FROM [Glossary]
WHERE (([Glossary].CoordinatorNam e) Like
Nz(Forms!JenSel ection!Coordina tor,"*")) And (([Glossary].Status) Like
Nz(Forms!JenSel ection!Status," *")) And
(([Glossary].MaintenanceCat egory) Like
Nz(Forms!JenSel ection!Maintena nceCategory"*") ); 2 2585
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].CoordinatorNam e, [Glossary].Status, [Glossary].MaintenanceCat egory FROM [Glossary] WHERE ((([Glossary].CoordinatorNam e) Like Nz(Forms!JenSel ection!Coordina tor,"*"));
This returns the correct number of fields using the function on one field.
This below does not: SELECT [Glossary].GlossaryTermID , [Glossary].CoordinatorNam e, [Glossary].Status, [Glossary].MaintenanceCat egory FROM [Glossary] WHERE (([Glossary].CoordinatorNam e) Like Nz(Forms!JenSel ection!Coordina tor,"*")) And (([Glossary].Status) Like Nz(Forms!JenSel ection!Status," *")) And (([Glossary].MaintenanceCat egory) Like Nz(Forms!JenSel ection!Maintena nceCategory"*") );
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.co m> wrote in message
news:e3******** *************** ***@posting.goo gle.com... 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].CoordinatorNam e, [Glossary].Status, [Glossary].MaintenanceCat egory FROM [Glossary] WHERE ((([Glossary].CoordinatorNam e) Like Nz(Forms!JenSel ection!Coordina tor,"*"));
This returns the correct number of fields using the function on one field.
This below does not: SELECT [Glossary].GlossaryTermID , [Glossary].CoordinatorNam e, [Glossary].Status, [Glossary].MaintenanceCat egory FROM [Glossary] WHERE (([Glossary].CoordinatorNam e) Like Nz(Forms!JenSel ection!Coordina tor,"*")) And (([Glossary].Status) Like Nz(Forms!JenSel ection!Status," *")) And (([Glossary].MaintenanceCat egory) Like Nz(Forms!JenSel ection!Maintena nceCategory"*") ); 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 onto the bottom of the list
(even though it keeps its record number).
Also, There are certin names that i click on the list, and
it will not bring it up, rather it brings to the first
record (no matter how many times i try going to that...
|
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 to record the record's
status.
Sample data:
*tblTest*
Model Parts CDate CStatus RDate RStatus
616 $359.79 03-Nov-03 C
|
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 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 .GlossaryID,...
|
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 the code that
implements managing unbound controls on forms given the superior
performance of unbound controls in a client/server environment. I can
easily understand a newbie using bound controls or someone with a
tight deadline. I guess I need...
|
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() function. Used to sum two
separate fields because I found that if there is a null field an
addition operation is not performed.
When running the ADO Recorset, I get the following message:
| |
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 zero-length string (always returns a zero-length
string when used in a query expression)"
****
How many records are there in FirstTable in which Product Is Null.
SELECT COUNT(*) AS CountofNullProdcut
|
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 form in Word. The information that I need to populate
this form is from 2 tables in an Access 2002 database (patient details
and GP details). Once the user has entered the patient and GP etc
details, they need to produce a case summary (including...
|
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 Access help
and the Nz function seems to be the way forward.
I am summing over 6 fields, all or none of which may contain values.
The expression syntax I have used is as follows:
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |