SELECT *
FROM [aTable]
WHERE [aTable].[aField] <> 'thing'
The query is returning most of the results where [aField] is not equal to 'thing'. But, it's also not returning results where [aField] IS NULL. Doesn't this mean that the query is thinking that "thing" = IS NULL?
after some effort i now have 2 databases set up that i use all the time to mail merge data into word documents. it is a much better system than i used previously and works great.
only annoyance i have is this. either because i have recently re-installed windows, or because i copy the documents and databases back and forward between my laptop and desktop computer, which use different drive letters for the main drives (i'm not sure which of these actions caused the problem), i now find that when i open any of my mail merge documents in word they open a dialogue box and are looking for the database on
C:userDocumentsFilesdatabase
when they should be looking on
D:userDocumentsFilesdatabase
how can i tell access to search on a different hard drive. i've searched and searched through the options but i cant find it. i had a similar problem once with word looking for all my docs on the wrong drive letter and i fixed that, but i can't fix it in access.
I'm creating a report to check for over- or under-stocked items. The report is working fine, gets all the records etc. except that it thinks that the OnHand field from my inventory query is text or something, at any rate not a number. I have successfully set the format of the field in the query to General Number, but that doesn't seem to have worked. Here's the SQL for the report:
Code: SELECT DISTINCT Signs.SignCode, Signs.SignDescr, Size2.XYdim, qryOnHand.OnHand, Bins.Rack, Bins.Level, Bins.BinNum FROM (Size2 INNER JOIN (Signs INNER JOIN (Items INNER JOIN qryOnHand ON Items.[ItemsID] = qryOnHand.[ItemsID]) ON Signs.[SignID] = Items.[SignID]) ON Size2.[SizeID] = Items.[SizeID]) INNER JOIN (Bins INNER JOIN InventoryDetail ON Bins.[BinID] = InventoryDetail.[BinID]) ON Items.[ItemsID] = InventoryDetail.[ItemsID] WHERE (((qryOnHand.OnHand)<=[Check for signs with fewer than:]));
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?
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 have a query that displays results in a form, but if the query is null, I want to display a different form, or just an error message that says something like "your query returned no results" (right now it will display the form with no fields)
I am a beginning Access/VBA user and have searched and browsed the forum for combinations of null/query/form, but haven't found what I need. Can anyone point me in the right direction?
Attached are screen shots of three queries used to get a percentage of jobs. If there is no jobs within the date range query 3 shows nothing. Can anyone tell me how if there are no jobs within the date range requested to get the query to give me 100%?
Hi, hope someone can help. I want the option of leaving perameters blank in a query in more than one field. the problem is that if I leave one blank and fill the perameters in for the other it brings all records up anyway. Is there a way around this? :rolleyes:
Hi All, I have searched and tried every post that I could find and can't seem to get this to work. What I have is 2 tables "training_tbl_200" and "topic_tbl_200". I have several querys "qry_training_215" thur "221" that make up my main query "qry_training_222" My main query will not show any records unless there is data in all of my subquerys. I need it to show a 0 if there is no training time in the category. Im not sure that I have explained this correctly so I have attached a copy of the database. I results that I need are if you run the query for August you can see that it should look like. In Feb there was training but nothing is showing up.
Thanks in advance for all your help...You guys and Gals are the best.
I have a query with Product, Product Directorate, Date Received, Date Delivered, and Date approved fields.
Product field criteria: "NAT CONV"
Product Directorate criteria: ([forms]![frmWhatDates].[cboPD]) or ([forms]![frmWhatDates].[cboPD is null)
Date Received criteria: (Between [forms]![frmWhatDates].[txtRecvStart] And [forms]![frmWhatDates].[txtRecvEnd]) or(([forms]![frmWhatDates].[txtRecvStart] is null) or ([forms]![frmWhatDates].[txtRecvEnd] is null))
and so forth
When I closed my query, and opened it up again it looked bizarre. Because of the Is Null it added criteria multiple times.. I don't know what's going on but this makes it hard if i want to edit it in the future.
Why did Access do this to my query? Is there anyway I can make this simpler and how?
What I have is a form that filters records according to what is input and it generates a report. If that date fields are left blank.. I want it to display all the records
I need to create a query with the MTD field I have created the MTD and it works!!! but now I need it to show all of the PartNum fields even if null. do I need to convert all nulls to zeros? if so how do I go about this?
Here are the fields in the query
First Field: Field: PartNum Table: Part Total: Group By
Second Field: Field: UnitPrice Table: OrderDetail Total: Group By
Third Field: Field: NumOrdered Table: OrderDetail Total: Sum
Fifth Field: Field: CurrentYear: Year([OrderDate]) Table: (blank) Total: Group By Criteria: Year(Date())
Sixth Field: Field: CurrentMonth: Month([OrderDate]) Table: (blank) Total: Group By Criteria: Month(Date())
When I run the query I only get 2 parts and their total. but I want all parts to show up even if they have not been ordered in the month. the parts that have not been ordered should say $0.00 in the MTD field.
Yes, another of my query troubles. I am running a query that is showing the number of demos booked, number of demos executed, then the percentage of demos executed. I have 2 demos that have 1 or 2 booked, but they have not been executed. They should show up in the query so I can get a percentage for them, but they do not. Here is my SQL:
SELECT [Promo count].PromoNo, [Promo count].[# of Demos], Count(Query6.Status) AS CountOfStatus, IIf([CountOfStatus]=0,0,[CountOfStatus]/[# of Demos]) AS Percentage FROM [Promo count] INNER JOIN Query6 ON [Promo count].PromoNo = Query6.PromoNo WHERE (((Query6.Status)="E")) GROUP BY [Promo count].PromoNo, [Promo count].[# of Demos];
I am trying to build a table from data stored in our SQL server, my problem is I want all accounts specified in the query to be listed regardless if they purchased a particular item or not. If they didn't then I want a zero for that record however I am having trouble accomplishing this I have tried IIF IsNull and a left join could someone look at this code and see what I maybe doing wrong. The table Spring2007 is a list of the items I want to lookup the sales for but if a particular customer did not purchase anything in Spring2007 I want it to list the item and the customer number (CTM_NBR) as 0
PS: when I started the Left Join was an INNER Join and I did not use the IIF IsNull
I have a form which a user can select upto 3 different options to search the main database.
The main table has: RVA Date Council Introducer PS NO Period Asset Description Current Cost SSAP21 Position
The three fields the user can search on is: Council PS No. Asset Description
I have created 3 individual queries to find the records for each of the above, as the other two choices could be left blank.
Not sure if one super query can be done to show the records based on the user input (as I say one or two choices could be left blank).
So far I have managed to get a main query (based on the 3 other queries) to work on all choices made by the user except Asset Description with the other two left blank.
I have made relationships between the three queries on the main query. Linking Council,PS No. & Asset Description to each other.
Almost there, just need the main query to work on the user selecting Asset Description only.....
Hi, I have a problem with my query. I have a table which has a record of payments, the fields are id/datepaid/reference/amount
My first query works fine. its simply to find the payments between two dates. The criteria is Between [Enter Start Date] And [Enter End Date] which is under datepaid. This query is saved as qrydatepaid. The problem Im having is when I try to use this query in another query. My other query is to show the dates not paid between the dates. I want to do this simply by adding qrydatepaid into a new query (qrydatenotpaid) and putting Is Null in the criteria under datepaid. When I do this it just comes up blank.
I am attempting to run a query that only captures the fields that are null so that I can run a report that shows outstanding information still required.
Essentially, each record is a provider. I have reviewers that complete an Access Form to certify each provider. The form consists of approx. 120 checkbox criteria. If it is checked they meet that criteria...unchecked they do not. The form is based off of 4 tables of which I am querying from.
I'm trying to get a query to identify only those criteria that are unmet for each provider. In other words...only show the unmet fields/checkboxes. From that I'll make the report.
I am trying to build a table from data stored in our SQL server, my problem is I want all accounts specified in the query to be listed regardless if they purchased a particular item or not. If they didn't then I want a zero for that record however I am having trouble accomplishing this I have tried IIF IsNull and a left join could someone look at this code and see what I maybe doing wrong. The table Spring2007 is a list of the items I want to lookup the sales for but if a particular customer did not purchase anything in Spring2007 I want it to list the item and the customer number (CTM_NBR) as 0
PS: when I started the Left Join was an INNER Join and I did not use the IIF IsNull
I have to give a three paramters queries. But i have to handle null responses also in such a way that in one parameter or two parameters i don't want to enter value and the result should bring all possible values with the parameters I entered
Like customer, status and order number in different fields
when i don't enter order number the result should bring all values in status and customer
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
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.
What I need to accomplish is an alert if a query finds any records. In other words, When the main page is loaded a query will run in the background. This query is looking for any records that need to amended within the next 30 days. What i would like to do is if the query finds any records that need amending an alert "form" or conditional formatting in a field with turn it red as an indicator that attention is needed.
My problem is how do i write a code to see if the record set from the query is greater than null???
Hi, I have a problem with one of my query, the query has 2 tables, the secondary field from Table2 is linked to the primary field of table1. The primary field Doesn't allow null Value The Secondary Field does allow null value which means that the Data in table 1 only concern Some of Table2's Data. If I run the query with the two tables I can only see the records with the secondary field with no Null Value. Is it possible to get the query Showing All the records of table1 2 and Table1 even if Table1 has no values?
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";"")