Select from query that excludes records based on a field criteria
When I enter Not "cucumbers" for the invert field criteria, I only see records in which there was an invert recorded, and it was not a cucumber .
I want to retain all records, whether and invert was observed or not, except for those in which the invert was a cucumber.
Thank you for taking the time to report an issue.
What's wrong... Please write below.
The field that will eventually be the Primary Key in the parent table is "SBNumber". SO, there are a bunch of records with duplicate SBNumbers with many different SpecTypes.
What I need to determine is what SBNumbers have records WHERE SpecType = 'Type1' and NO records WHERE SpecType = 'Type2'. This seems like such a simple thing but I can't seem to get anything to work.
I am relatively new to this and still feeling my way around.
dim rst as adodb.recordset
set rst = new adodb.recordset
rst.open "select * from officeTemp", currentproject.connection
But the problem is that rst now possesses a set that is, say, 50 entries long. If I open up "select * from officeTemp" manually in Access, it shows 42 records (and correctly excludes 8 records as denoted in the criteria of the query
I had tried a similar thing before but found that this would bring up all the records on the query, ignoring the query criteria/parameter.
Not completely great with the whole programming thing and would like to be able to do in in a query (design view) if possible.
In this topic:
* Introduction to query criteria
* Criteria for Text, Memo, and Hyperlink fields
* Criteria for Number, Currency, and AutoNumber fields
* Criteria for Date/Time fields
* Criteria for other fields
However, I want to give the end users the option of leaving a data field in Table B blank, thereby not specifying any criteria and returning all values in Table A. That is where I am running into a problem
2. You click the button Find Meals which only has the code me.refresh.
3. The sub form is based on a select query that reads the criteria off the main form and refreshes the sub form (continuous form) with the correct data. See Pic 1.
4. The select query is based on one table. See Pic 2.
I add one additional field from the table to the query. I then add the field to the sub form.
When I reopen the main form the sub form has disappeared from the screen. I select the same criteria in the parent form and click the button and nothing shows up. See Pic 3.
I know it can be done but cannot find it in help. I even created a record in my UserTbl with blank for initials but then I get zero records
Each of these criteria have an "ALL" option which, if selected, will prevent that criteria from being added to the WHERE clause in the Query string.
Currently, this is done in VBA, but I was wondering if there was a way to do this in the SQL statement itself (or the Query designer in Access), so I can rely less on VBA.