473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Greater Than Equal To Criteria for Query Not Working!

Hello,

In the criteria for a query, I try entering >=10 but it keeps showing me everything below and above 10. It's like the criteria I entered isn't changing anything! I am new to access, so this is pretty frustrating. Can someone please help!

I linked what I am talking about here (Refer to YearsOfService):
{Link removed}

Thank you!
Mar 17 '18 #1
9 5798
NeoPa
32,556 Expert Mod 16PB
Firstly, please try to follow the instructions on posting a new question. You're new so may have gone straight to posting without checking the instructions first. That's not the best way to approach things.

In this case it's important that you explain fully what you're working on. Is it a numeric field you're filtering? If you need to post pictures then you can attach it to your post. Do not link to external sites for that.

There is a massive difference between >=10 and '>=10'. Without knowing the type of the field you're applying it to it's hard to guess at exactly where you've gone wrong.
Mar 17 '18 #2
{Illegal link removed}

That's the link I was talking about...

Yes, it is a numeric field I am trying to filter. What I entered was >=10

So when I go into DataSheet view I can see numbers under 10, (like 9 and 5) as you can see in the link I have attached.

Please help!! Thank you!
Mar 17 '18 #3
NeoPa
32,556 Expert Mod 16PB
JimBobJumbalia:
as you can see in the link I have attached.
That is not an attached link - that's an external link. Not helpful. I even took my safety in hand and tried to link to it - just to test whethere or not it was safe. I got nothing, so I hope it wasn't a malicious link that ran unwanted code.

The main point is that you don't link off to such sites. Only sites which are about the product (Access) and are not either commercial or provided by the provider of the product (Microsoft).

As for your issue, I'm not sure filters even work in DataSheet view. I very rarely use it myself. Do you also see records where the value is greater than ten or do you only see those less than ten?
Mar 17 '18 #4
I apologize for that. And it was not a malicious link, so no need to worry about that.

What I meant was that when I ran the query in DataSheet view it showed me values greater and less than ten, when I set the Criteria to >=10

I am not sure why it isn't working!

I guess I'll explain what it is that I am working on since I cannot send you any pictures of it! So the query has 4 different fields: EmployeeNumber, BaseSalary, YearsOfService and VirtualEquity. VirtualEquity is BaseSalary*YearsOfService derived via a calculated method in the query. And I just need to show all employees who have worked for 10+ years (YearsOfService >=10). Now, this is where I am stuck!

I will appreciate any kind of help!
Mar 18 '18 #5
Luuk
1,047 Expert 1GB
Pleas show the SQL you have, it is something like:
Expand|Select|Wrap|Line Numbers
  1. SELECT employees.[EmployeeNumber], employees.[BaseSalary], employees.[YearsOfService], employees.[VirtualEquity]
  2. FROM employees
  3. WHERE  employees.[YearsOfService] >10;
  4.  

This is posted using the '[CODE/]' button in the bar above where I type this. In that bar is also a button to insert an immage ....

Or attach an image via 'Go Advanced', 'Manage attachments'

Attached Images
File Type: png 2018-03-18 18_16_02-Microsoft Edge.png (4.9 KB, 2470 views)
Mar 18 '18 #6
Hello! Thank you for the reply, but I have figured it out. My Data Type was not Number. Automatically added the quotation marks around the 10:

>="10"

So when I changed it, it fixed the problem!
Mar 18 '18 #7
PhilOfWalton
1,430 Expert 1GB
I rather doubt it.
If you type
Expand|Select|Wrap|Line Numbers
  1. ? "9" >= "10"
  2.  
In the immediate window, you will get True.

Why isn't YearsOfService Numeric?

Phil
Mar 18 '18 #8
Luuk
1,047 Expert 1GB
I bet jimbobjumbalia did change the column to Numeric ! ...
Mar 18 '18 #9
NeoPa
32,556 Expert Mod 16PB
Hi JimBob.

You may have gleaned from the other posts here some of the importance of field types with the filter strings. I have an article (Quotes (') and Double-Quotes (") - Where and When to use them) that may help with that understanding. A very important understanding without doubt.

Phil in Post #8:
? "9" >= "10"
Note from this that digits held in strings do not behave the same way as those same digits when held as numeric data. It is important that you convert your filter back to using a numeric value and the matching field to a numeric field. Otherwise you'll fall over more items that seem bewildering, but actually make perfect sense when you understand that it's comparing text values on not their numerical equivalents.

JimBobJumbalia:
I apologize for that. And it was not a malicious link, so no need to worry about that.
Good to know. As I said in my first response, I suspected it was simply a lack of knowing your way around.

See Luuk's post #6 to see that pictures can be posted and displayed here.
Mar 18 '18 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: erikcw | last post by:
Hi all, I'm trying to run the following query: amember_db = MySQLdb.connect(host="localhost", user="**********", passwd="*****", db="*******") # create a cursor self.amember_cursor =...
6
kamill
by: kamill | last post by:
I need to generate a report (with fromdate and todate).If we set the “from” date and “to” dates as the same it should generates a report for that date. If we set the “from” date as one day before...
3
by: sfrvn | last post by:
I have searched high and low and cannot find an answer to my problem. So now I turn to the collective genius of this newsgroup. Over-simplified examples This query criteria for field works:...
1
by: akirekab | last post by:
I am using DCount, but I am not able to find how to set simple multiple criteria. Here is sample of what i need. =DCount("PatientProfileID","qryFaceToFaceReason_EAP_VG","FaceToFaceReasonID=2"...
11
by: woodey2002 | last post by:
This problem is driving me crazy. Hello there, i am trying to create a search form for records in my access database. The search form will contain text boxes and a multi select list box. The user...
4
by: wassimdaccache | last post by:
Dear All I am using this function to make the sum of values in my query nz(DSum("Total","fuel_move","id_fuel_move='" & barcode_product & "'" & "and date_fuel_move between" & And ),0) AS...
6
by: toadmaster | last post by:
Hello, I would truely appreciate it if I could have some input with this issue. I have an access query, I am trying to get it to filter the results based on the date input that pops up when...
2
by: Knowlton | last post by:
I have a query for the rowsource of a combo that returns null even though there are matching records. I assign this query in the AfterUpdate event of another control(SeedBrand). During debugging the...
1
by: rich1838 | last post by:
I have a database with a search form that has been working flawlessly and now has completely stopped. The Form has 3 fields (a Date field, a combobox field, and a text field). As I said, it worked...
5
by: madg | last post by:
I am trying to use the .FindNext (and .FindPrevious) function on an update form "next button" to find the record that meets certain criteria. Private Sub NextRecord_Click() Dim foundmatch As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.