A bit of a weird one, I've got a query and the criteria for showing records is that one particular field is null. However the query is showing records with the values in the field chosen for the Is Null.
Not sure why this is happening, has anyone come across this problem before?
Depending on the answer of a question, i would like to get the records that have no data in that specific field, otherwise i want the query to give me all records. I've tried this in "criteria" but it doesn't work: IIf([Question? J/N]="N";"Is Null";"")
I have what I think is a simple query returning the names of students that have been dismissed since September 2012 using a "WithdrawnDate" field. The query pulls a lot of information from other related tables (about 6 different ones), and has two expressions.
When the criteria is set to either "Is Not Null" or a date range (which is all I need), it does not return the complete set of records based on the data that fits the criteria in the main table?
Could there be some sort of join preventing all records from being returned?
I have just joined the forum and spent the last day or so looking around for an answer that I wasn't able to find.
I have been asked by my employer to capture details of who has signed our confidentiality policy. I have made a very simple database which only has three tables, EMPLOYEE, POLICY and VERSION.
EMPLOYEE has three fields, NAME, NUMBER and BRANCH. POLICY has three fields, NUMBER, DATE and VERSION. VERSION has two fields, VERSION NUMBER and DATE. I won't worry about the VERSION table any further in this post as it doesn't figure in the problem query.
Primary key for EMPLOYEE is NUMBER. Compound key for POLICY is NUMBER and DATE (ie. the employee can sign the policy more than once and we want to record when this was, and whether the policy version changed).
I have an Access "type 3" join defined in table relationships from EMPLOYEE.NUMBER to POLICY.NUMBER.
I am trying to write a query that returns the employees that haven't signed the policy. I have no problem returning the employees that have (ie. employees whose numbers match the numbers in the POLICY.NUMBER field), but it is the EMPLOYEE.NUMBER entries that are not present in POLICY.NUMBER that are causing me grief.
I have tried using the expression builder in the query builder window (it gave me <>[tblPolicy]![Number]) which doesn't return any records (I have over 490 in the database and should be getting back at least 50 or so).
Hi. I'm unable to work out how to set up a query which will filter records according to what is returned by one control, but will also list all records if the value of the control is null.
Situation: I have a CONSULTATION table linked many to many via a CONSULTATIONLIST relation table to an ADVISOR table. (An Advisor may be present in any number of Consultations, and a Consultation may include any number of Advisors.)
I have a CONSULTATIONMANAGE form enabling the user to select an Advisor from the table ADVISOR via a combo box called SELECTADVISOR which returns Advisor ID (adID).
My CONSULTATION form, displaying the list of consultation records, currently has, as record source, the following query:
SELECT Consultation.*, Advisor.adID FROM Consultation INNER JOIN (Advisor INNER JOIN ConAdList ON Advisor.adID = ConAdList.adID) ON Consultation.conID = ConAdList.conID WHERE (((Advisor.adID)=[Forms]![ConsultationManage]![selectadvisor]));
This query correctly lists only those Consultations in which the selected Advisor was present.
Problem: What I also need to do is show ALL Consultation records if the user does not select an Advisor from the combo box.
I have a left-join query where I know that some of the values in the left-hand table have no corresponding values in the right-hand table...that's why I used a left-join: I want all the values in the left-hand table to show up. I would expect that records without corresponding values in the right-hand table would show up as nulls (I swear I have dozens of other queries that work this way) but in this one, they show up as "#error" instead.
This is a problem because I want to do some calculations on this field. Normally I would use the nz function to change the nulls to zeros.
So, 1. Any idea why this is happening? 2. Is there a way to change the #error values to zeroes, similar to using the nz function?
HEre's the SQL: SELECT FeederInventorySummary.machine, FeederInventorySummary.Size, FeederInventorySummary.Leaf, FeederInventorySummary.Type, FeederInventorySummary.CountOfFeederID,FeederNeeds Summary_7.FeederQty FROM FeederInventorySummary LEFT JOIN FeederNeedsSummary_7 ON (FeederInventorySummary.Type = FeederNeedsSummary_7.Type) AND (FeederInventorySummary.Leaf = FeederNeedsSummary_7.Leaf) AND (FeederInventorySummary.Size = FeederNeedsSummary_7.FeederSize) AND (FeederInventorySummary.machine = FeederNeedsSummary_7.ActualMachine);
For every record without a corresponding record in FeederInventorySummary_7, the FeederQty field shows up
2007 version - my child query is not returning null values. I have 2 fields, both pulled from a parent query. One is "DaysSinceRecd", the other is "AmountPaying". The parent query returns multiple results, which is fine. For example, the parent query might have 10 different records for "0" "DaysSinceRecd", with different "AmountPaying" for each of those records.
In the child query, I am trying to condense that down, so that I only have one "AmountPaying" for each "DaysSinceRecd". It's working fabulously, except that there are records in the parent query that have a value for "AmountPaying" but a null value for "DaysSinceRecd". The null value for "DaysSinceRecd" cannot be changed to another value, it needs to stay null. My child query is not returning the null records. I tried adding to the criteria: IsNull Or IsNotNull, >=0 or <=0. That's not working.
Hi, first of all I have to say I'm quite a noob at Access, so I apologise if my question seems stupid. :p I Googled for quite a bit looking for a solution but couldn't really get anything to work (maybe because I wasn't doing some of the possible solutions correctly?).
Anyway, I have a database with two tables, and I'm trying to make a QBF to search for data from these two tables. Quite a few of these entries have null values.
SELECT [M-Table].Firstc, [M-Table].Secondc, [S-Table].Thirdc FROM [M-Table] LEFT JOIN [S-Table] ON [M-Table].Firstc = [S-Table].Firstc
((([M-Table].Secondc) Like "*" & [Forms]![interface]![TxtSecondc] & "*") AND (([Forms]![interface]![TxtFirstc]) Is Null) AND (([Forms]![interface]![TxtThirdc]) Is Null))
OR ((([M-Table].Firstc) Like "*" & [Forms]![interface]![TxtFirstc] & "*") AND (([Forms]![interface]![TxtThirdc]) Is Null) AND (([Forms]![interface]![TxtSecondc]) Is Null))
OR ((([S-Table].Thirdc) Like "*" & [Forms]![interface]![TxtThirdc] & "*") AND (([Forms]![interface]![TxtFirstc]) Is Null) AND (([Forms]![interface]![TxtSecondc]) Is Null))
OR ((([M-Table].Firstc) Like "*" & [Forms]![interface]![TxtFirstc] & "*") AND (([M-Table].Secondc) Like "*" & [Forms]![interface]![TxtSecondc] & "*") AND (([Forms]![interface]![TxtThirdc]) Is Null))
OR ((([M-Table].Secondc) Like "*" & [Forms]![interface]![TxtSecondc] & "*") AND (([S-Table].Thirdc) Like "*" & [Forms]![interface]![TxtThirdc] & "*") AND (([Forms]![interface]![TxtFirstc]) Is Null))
OR ((([M-Table].Firstc) Like "*" & [Forms]![interface]![TxtFirstc] & "*") AND (([M-Table].Secondc) Like "*" & [Forms]![interface]![TxtSecondc] & "*") AND (([S-Table].Thirdc) Like "*" & [Forms]![interface]![TxtThirdc] & "*"))
OR ((([M-Table].Firstc) Like "*" & [Forms]![interface]![TxtFirstc] & "*") AND (([S-Table].Thirdc) Like "*" & [Forms]![interface]![TxtThirdc] & "*") AND (([Forms]![interface]![TxtSecondc]) Is Null));
This really long and tedious code was the only way I could get it to work such that in my query form, if I leave any one of the fields blank the search will still pull all the related results out, regardless of whether there are nulls in the values themselves, e.g. if I search for anything with "ab" in Secondc, it will give me all the data with "ab" in Secondc, even if there are null values for those entries in Firstc and Thirdc. Similarly for searches with the other fields.
I tried using IIF and Nz, first using IIF under Criteria, then I read somewhere that they should be used under Field rather than Criteria, but I couldn't really get it to work. Either the QBF wouldn't return any results, or it would return only those entries without null values, so if I searched for "ab" in Secondc, I wouldn't get the entries that had "ab" in Secondc but null values in either Firstc or Thirdc.
The problem with my solution is that I wouldn't be able to get it to work in another database with like 10 fields. The number of combinations would be a killer...
1. User need to look up item name, while in a subform. He pressed F5 2. A form showed up, with a ComboBox (which got its values from a query) 3. User chose an item name in the ComboBox, and then pressed the Close button 4. The item name got copied into the subform.
Problem is, for some items/records, step 4 doesn't happen :eek: When I investigated, turned out that for some records, the ComboBox returned null (instead of the selected record)
Hi, I have a query which works perfectly and deletes the unnecessary records according to the criteria i have set , but i dunt want this null values in all column to display in the exported output file. how do i delte the records which are already null . i tried delete query but it did not work
Hi, I have a query which works perfectly and deletes the unnecessary records according to the criteria i have set , but i dunt want this null values in all column to display in the exported output file. how do i delete the records which are already null . i tried delete query but it did not work . This is in microsoft Access.
Simple query, but I need to roll the results up with others and a null return is hurting me. I have been chasing my tail around with the nz(), input masks, IIF statements, only to prove my ignorance and possible insanity for expecting different results.
Here we go:
SELECT Count([LDB LOG].DSTHTL) AS ["tot120"] FROM [LDB LOG] WHERE ((([LDB LOG].[LDB Rcvd]) Between Now()-120 And #1/1/2008#)) GROUP BY [LDB LOG].[T-7 Date] HAVING ((([LDB LOG].[T-7 Date]) Is Null));
This is being used to count open items into age buckets, the above is the greater than 120 days (discounting anything prior to 2008). If the T-7 Date is null the item is open. What is happening is that no records are being selected, resulting in the null value back.
Any help would be greatly appreciated as I have spent an unrealistic amount of time on this.
I need a date prompt and null records in the same line of criteria so I get all those within a certain date range under the field "CO_resp_rcvd" and those that didn't respond yet but need to -- is that possible to do both and if so how would you show me how?
This is what I have currently in my query
CO_resp_rcvd (date field)
Criteria: Between [Start Date] And [End Date]
(I need null values as well because there will be some if the CO has not responded yet but needs to)
This formula gives me the number of bus days from the Review Date - CO_Resp_Rcvd Date and that works but if the CO-Resp-Rcvd date is null, I need it to calculate Review Date - Today's date to show the number of days outstanding for those that have not responded yet in the same formula?
Not sure how to combine it to work - the wrapper is a bus day function
This is what I have so far in the query
CO-Bus Days to Respond: Wrapper([Review Date],[CO_resp_recd]) but if CO_resp_recd is null then ([Review Date],Date())
It might be an easy one but I just wasted the past hour deciphering through my code in order to solve the run-time error '94' that I'm getting when trying to execute the following code:
Code: Private Sub cmdUpdateDates_Click() '################################### 'This sub aims at combining the timesheet date and the start and end time into the fields [Start Time] and [End Time]. '################################### Dim intCounter As Integer intCounter = 0 Dim rs As ADODB.Recordset
I am having problems with setting up a set of combo boxes.
What I am trying to do is if combo Productline is empty then in combo PartNumber would show all products but if combo Productline has a value selected then in the combo partnumber would only be able to select the partnumbers in that productline.
Been taking abreak from Access for a few years now and cant get my head round my problem.
I have been asked to manipulate data from a Training Recods database.
Basically, training consists of 26 modules, there are currently 180 people who need training. Each person has been assigned a unique number, once a module has been completed, the date it was completed is entered into the database. There are currently lots of modules which havent been completed, what I need is a way of pulling that data from the DB.
I need to know how many people need to complete each module. For example, Module 1 might need to be completed by 15 people, Module 2 might need to be completed by 27 people etc.
I have enclosed the DB with the table and the form that I am looking to populate with the data.
Anyone have any ideas, I just can't get my head round it!!!!
I have a form for booking employee holidays and in that I have a subform that displays their current holiday entitlment, which work great until I enter in a new record on the main form to book some holidays and I'm ask for a Name from a parameter box?? which I press cancel or ok at which point the subform goes blank (which is whatI want) but when I enter the employees name from the combo list it doesn't update the subform?
my question is; how do i remove the parameter box and update the subform once I have selected the employee name??
I recently acquired a database that is already established. When entering new date the primary key is null. I've looked at the properties and the best I can figure is it has something to do with a missing property called New Values.
Ok this null value thing is killing me. I have a parameter query that works great. I know if I use Is Null in the criteria field it will show me this. The problem is I made a search form which the users type the value in and it opens a form based on the parameter query, the parameter on the query is [Forms]![Search_frm]![txtClosed]. If they type a date in here it opens the form and shows the user all the closed records. The problem is they want to see all the records that have no value or Null. I've tried eveything to make this work. I'm ready to jump!! Just kidding. Is there a way to do this with out creating another query. Thanks a bunch!!!