Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Query crireria

Posted on 2014-07-31
8
Medium Priority
?
126 Views
Last Modified: 2014-07-31
I normally use this criteria to get a query to filter the records if there is a value in form field and ignore it if not plus any records in the query that have no values in the criteria field

Like nz([Forms]![Doors]![E],"*") Or Is Null

But now I need to say if there is a value in the form field I want all the records with values greater than the form field value plus any records in the query that have no values in the criteria field

Like nz(>=[Forms]![Doors]![E],"*") Or Is Null

But I cannot get it to work
0
Comment
Question by:DatabaseDek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 40231301
Try this:

>=  nz([Forms]![Doors]![E], -999)


(-999 is some arbitrary value that is lower than any 'reasonable' value in your data)
0
 

Author Comment

by:DatabaseDek
ID: 40231325
The problem is the null values

I have just done this in a query grid field to return a zero if there is a null but it appears that the criteria runs before the selection below. So it will convert nulls to zeros but after the criteria has already eliminated the nulls.

A: IIf(Mid([AcousticRating],3,4)>0,Mid([AcousticRating],3,4),0)
0
 

Author Comment

by:DatabaseDek
ID: 40231329
Which means that my idea to make your solution work did not work.

So your idea is brilliant if I did not have nulls
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 61

Expert Comment

by:mbizup
ID: 40231342
Perhaps this:

>=  nz([Forms]![Doors]![E], -999)  OR IS NULL

If that doesn't help, post the SQL and some sample data.
0
 

Author Comment

by:DatabaseDek
ID: 40231372
The problem is the nulls. How do I get this greeter than criteria and also get the Nulls
0
 

Author Comment

by:DatabaseDek
ID: 40231392
This was the solution

>=nz([Forms]![Doors]![K],"*") Or Is Null Or nz([Forms]![Doors]![K],"*")

I have no idea how it works but it does so!
0
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 40231400
That last nz looks redundant.

Try this:

>=nz([Forms]![Doors]![K],"*") Or Is Null

The issue with the syntax in your original post is that the >= needed to be *outside* of the NZ.

Regarding the "*" versus -999, are you dealing with TEXT fields rather than numeric fields?  If so the "*" behaves similarly to the -999 (which would work for numeric fields).  It is simply an arbitrary low value, which alphabetically comes before any expected values in your data.
0
 

Author Closing Comment

by:DatabaseDek
ID: 40231671
Wicked!!

Thank you

Derek
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question