Query Criteria is not working

I am having an issue with the criteria of a query.

I am limiting the data by a date range, an account code, and the number of 
loads.
The date uses   BETWEEN @FromDate AND @ToDate
The account code uses  NOT = 4125 OR NOT = 4121
The loads is > 0

With the above scenerio, I get no loads which are 0, but I still get account 
codes 4125 and 4121.

If I put the account criteria in seperate columns, then I remove those 
account codes, but then I get loads that have 0.

Any ideas?
Cahd



0
Chad
3/9/2010 11:41:50 PM
access 16762 articles. 3 followers. Follow

6 Replies
897 Views

Similar Articles

[PageSpeed] 16

my mistake.
I needed to use NOT = 4125 AND NOT = 4121

thanks
Chad

"Chad Cameron" <chadNOT483@hotmail.com remove NOT> wrote in message 
news:e57FMI%23vKHA.4636@TK2MSFTNGP06.phx.gbl...
>I am having an issue with the criteria of a query.
>
> I am limiting the data by a date range, an account code, and the number of 
> loads.
> The date uses   BETWEEN @FromDate AND @ToDate
> The account code uses  NOT = 4125 OR NOT = 4121
> The loads is > 0
>
> With the above scenerio, I get no loads which are 0, but I still get 
> account codes 4125 and 4121.
>
> If I put the account criteria in seperate columns, then I remove those 
> account codes, but then I get loads that have 0.
>
> Any ideas?
> Cahd
>
>
> 


0
Chad
3/9/2010 11:51:00 PM
Hi Chad,

Why don't you post the SQL of your query and then someone can easily help 
you.
Open your query  in the query design panel and right click on the top bar 
and choose sql view.
copy that text and post it in a message.

Regards

Kevin


"Chad Cameron" <chadNOT483@hotmail.com remove NOT> wrote in message 
news:e57FMI%23vKHA.4636@TK2MSFTNGP06.phx.gbl...
>I am having an issue with the criteria of a query.
>
> I am limiting the data by a date range, an account code, and the number of 
> loads.
> The date uses   BETWEEN @FromDate AND @ToDate
> The account code uses  NOT = 4125 OR NOT = 4121
> The loads is > 0
>
> With the above scenerio, I get no loads which are 0, but I still get 
> account codes 4125 and 4121.
>
> If I put the account criteria in seperate columns, then I remove those 
> account codes, but then I get loads that have 0.
>
> Any ideas?
> Cahd
>
>
> 


0
kc
3/9/2010 11:56:34 PM
The account code criteria needs to be --
     <> 4125 AND <> 4121

-- 
Build a little, test a little.


"Chad Cameron" wrote:

> I am having an issue with the criteria of a query.
> 
> I am limiting the data by a date range, an account code, and the number of 
> loads.
> The date uses   BETWEEN @FromDate AND @ToDate
> The account code uses  NOT = 4125 OR NOT = 4121
> The loads is > 0
> 
> With the above scenerio, I get no loads which are 0, but I still get account 
> codes 4125 and 4121.
> 
> If I put the account criteria in seperate columns, then I remove those 
> account codes, but then I get loads that have 0.
> 
> Any ideas?
> Cahd
> 
> 
> 
> .
> 
0
Utf
3/10/2010 12:25:02 AM
On Tue, 9 Mar 2010 15:41:50 -0800, "Chad Cameron" <chadNOT483@hotmail.com
remove NOT> wrote:

>I am having an issue with the criteria of a query.
>
>I am limiting the data by a date range, an account code, and the number of 
>loads.
>The date uses   BETWEEN @FromDate AND @ToDate
>The account code uses  NOT = 4125 OR NOT = 4121
>The loads is > 0
>
>With the above scenerio, I get no loads which are 0, but I still get account 
>codes 4125 and 4121.

If you use OR, then you'll get all records because 4125 is in fact not equal
to 4121, and vice versa.

>If I put the account criteria in seperate columns, then I remove those 
>account codes, but then I get loads that have 0.

I have no idea what you mean.

Try a criterion on account code of

NOT IN(4121, 4125)

-- 

             John W. Vinson [MVP]
0
John
3/10/2010 12:58:03 AM
"Chad Cameron" <chadNOT483@hotmail.com remove NOT> wrote in message 
news:e57FMI%23vKHA.4636@TK2MSFTNGP06.phx.gbl...
>I am having an issue with the criteria of a query.
>
> I am limiting the data by a date range, an account code, and the number of 
> loads.
> The date uses   BETWEEN @FromDate AND @ToDate
> The account code uses  NOT = 4125 OR NOT = 4121
> The loads is > 0
>
> With the above scenerio, I get no loads which are 0, but I still get 
> account codes 4125 and 4121.
>
> If I put the account criteria in seperate columns, then I remove those 
> account codes, but then I get loads that have 0.
>
> Any ideas?
> Cahd
>
>
> 

0
De
3/13/2010 5:32:45 PM
kkbbb

"Chad Cameron" <chadNOT483@hotmail.com remove NOT> a �crit dans le message 
de groupe de discussion : e57FMI#vKHA.4636@TK2MSFTNGP06.phx.gbl...
> I am having an issue with the criteria of a query.
>
> I am limiting the data by a date range, an account code, and the number of 
> loads.
> The date uses   BETWEEN @FromDate AND @ToDate
> The account code uses  NOT = 4125 OR NOT = 4121
> The loads is > 0
>
> With the above scenerio, I get no loads which are 0, but I still get 
> account codes 4125 and 4121.
>
> If I put the account criteria in seperate columns, then I remove those 
> account codes, but then I get loads that have 0.
>
> Any ideas?
> Cahd
>
>
> 
0
joelgeraldine
3/17/2010 1:47:07 PM
Reply:

Similar Artilces:

Drillthrough report using "Jump to URL" quits working when Parent Report Parameter values are changed
I have a summary report that lists totals and the report has the ability to drillthrough to another "details" report by clicking the numbers on the summary report. The details report is rendered in a separate window using "Jump to URL" and passing the parameters from the summary report to the details report. This has worked fine for some time, but my problem is I need to modify the values of one of the report parameters that is used by the summary report and passed to the detail report. When I modify the parameter "value" and deploy the report the ...

Timer for Queries?
Does anyone know of a macro or add-on that I could use as a simple timer for queries? I don't like to use the CPU time in the Task Manager because of it's inaccuracy when not receiving full CPU usage. THanks for any suggestions -- cmungs Exactly what are you trying to accomplish? Are you trying to cause a query to run automatically every so often? If so, you will need to use the timer event on a form to do that. -- Lynn Trapp Microsoft MVP (Access) www.ltcomputerdesigns.com "cmungs" <cmungs@discussions.microsoft.com> wrote in message news:88EC7019-045F-4EF...

Working out UK tax
ive set up a spreadsheet to calculate my income per week. I now would like to make my tax and national insurance boxes to be calculated automatically. meaning all im required to do is type in my hours worked for that week. The problem is finding a formula that can do this. The UK tax and national insurance is directly proportional to how much you earn. Not one fixed percentage. Let me show us some numbers: - Payslip 1 Total Pay = 297.62 Tax = 40.65 = 13.7% N.I = 22.73 = 7.6% Payslip 2 Total Pay = 242.63 Tax =...

help!! forwarding rules do not work!
Hello, i have set a rule so that when i receive from a certain sender, i have it set to forward to an email address that is outside the domain. but the rule will not forward it. it will sometimes work if i use the "run now" button but never automatically. what should i do. the altimate goal is to have message from certain people auto forward to a moble device's email account. thanks jon ...

Erratic results from query criteria
I am getting different results from running the same query with the same selections. One moment it is all behaving as expected, the next it has gone haywire. (I have done what appears to me to be EXACTLY what I have done in another database, where it works perfectly every single time.) In a query I have, amongst others, the following fields: Category SubCategory Company I want to be able to select any OR ALL of the relevant fields. I have the following criteria: Like "*"&[Type Category otherwise leave blank for ALL]&"*" Like "*"&a...

Update Query ?
Is there a way to 1) Assign events when adding in data thru an update query for example if you append a bunch of data into a table could you then do some kind of an update query to say if there is an initial event and no others tag this one Renewal 1 etc.. the only real data you have to go on would be Customer A and the total amt .. the event, renewal event and the delta would all need to be added in example: Say Customer A comes in with an initial deal then Customer A renews their deal So, the data would look like when you're done.: Year Custo...

Remove-Item -recurse still doesn't work?
I remember having issues with remove-item -recurse in v1, but directly from get-help remove-item in v2: "The Recurse parameter in this cmdlet does not work properly." .... C:\PS>get-childitem * -include *.csv -recurse | remove-item .... Because the Recurse parameter in this cmdlet is faulty, the command uses the Get-Childitem cmdlet to get the desired files, and it uses the pipeline operator to pass them to the Remove-Item cmdlet. and yet this filed bug: http://connect.microsoft.com/PowerShell/feedback/details/87456/remove-item-recurse-and-copy-item-recurse-exclud...

design query match anywhere?
In the design query I want to match the letters "ABC" anywhere in the column 'description'. I could not get instr to work by using: InStr(description, "ABC")) > 0 How else can I match ABC (upper and lowercase) to anywhere in my 'description' column? Thanks! Are you saying you put that InStr bit as a criteria under your Description field in the query designer? Try putting Like "*ABC*" as the criteria instead. Alternatively, you could add a computed field to the query InStr([Description, "ABC") and then put >0 as the ...

Windows Media Player 11 stopped working
As near as I can tell, I have WMP version 11.0.6002.18111 installed on my Vista Home Premium system. I haven't used it in a while, so I'm not sure when the problem arose, but whenever I try to play a file or even just open the player, I'm informed it has stopped working with the following information provided: roblem Event Name: APPCRASH Application Name: wmplayer.exe Application Version: 11.0.6002.18111 Application Timestamp: 4aa91411 Fault Module Name: kernel32.dll Fault Module Version: 6.0.6002.18005 Fault Module Timestamp: 49e037dd Exception Cod...

Unexpected Error- Running Advance Find Query
I am getting a message that says "Unexpected Error An Error has occurred" when I am running an advanced find query on two custom entities. It seems to be when I have certain custom fields included in my view that the query errors out. Any help on this would be greatly appreciated. Thanks so much. Just wanted to add that I seem to get errors when there is a 0.00 amount in these fields... "TJ" wrote: > I am getting a message that says "Unexpected Error An Error has occurred" > when I am running an advanced find query on two custom entities. It se...

pass through query
If a combobox is populated by a pass-through query, does it requery every time the form is closed and reopened? Thanks, Sam Yes. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Sam wrote: > If a combobox is populated by a pass-through query, does it requery every > time the form is closed and reopened? > Thanks, > Sam ...

a count field in a query?
Hello, I have a query in which I would like to create a field which increments by 1 for each record selected, so if there are 10 records selected by the query, this column would show numbers 1 to 10. Ideally I would like to have some text in front of each number, say invoice1, invoice2 etc. From a previous posting I realise that this is frowned upon but it would be the simplest solution for my problem! How can I do this? Thanks Geoff On Mon, 03 Dec 2007 08:54:00 +0000, Geoff Cox <<>> wrote: >Hello, > >I have a query in which I would like to create a field which >...

E-mail hyperlinks won't work
I upgraded from Outlook 2000 to 2002 with my new PocketPC installation. Now when I click on any highlighted hyperlinks within a recvd e-mail msg, a dialog box pops up and it appears to start an unpacking tool to run an install for Acrobat Reader all on its own. It does with any hyperlink selected from any msg. Does anyone know where you go in to fix this. Thanks, Chris ...

Multiple criteria
Ok I have a workbook I am working on for someone else and my formulas will not work. Any help would greatly be appreciated. =SUMPRODUCT(--(C4:C59>=5900),--(C4:C59<=5999)) this works like a charm but I need to use this plus (e4:e59="g-shift"). I need the first formula to be the condition to count the second formula. so basically i want if c4 has 5950 and E4 has g-shift then I get 1 and if e4 is blank then i get 0. Everything I have tried says that the formula is wrong. Did you try: =SUMPRODUCT(--(C4:C59>=5900),--(C4:C59<=5999),--(e4:e59="g-shift")) I...

Saving Username and Pass with Web Queries
I am pulling data from a website that requires you to provide a usernam and password everytime you visit the site. Excel has cachin capabilities, but everytime you close excel and try and open up th spreadsheet again, it can't login. What is the fix for this? Thanks, Hend -- Message posted from http://www.ExcelForum.com Bump! --- Message posted from http://www.ExcelForum.com/ ...

Birthday query for many children in one record
I have a database for the church, it has one main flat table only. Each record for the parents have field for child1 name, child1birthday, child2 name, child2birthday, child3 name, child3birthday - up to 5 children. I am having difficulty trying to get a report to list the birthdays of the children like this parent name, child 1 name, child 1 birthday month etc. so you get something like this:- Parent John Smith, child Mary Smith January 3 Parent Fred Jones, child Bert Jones March 4 Parent John Smith, child Jane Smith March 6 Parent Harry Brown, child Jane Brown March 6 Parent Bert Taylor,...

Unresponsive Query Wizard
Hi there, I have an Excel 2003 user who is using a spreadsheet that pulls data from our SQL server. When he opens it and refreshes the data it is fine, it pulls the current data, but when he tries to edit the query, the Query Wizard does not appear, he can see it on the task bar, but when he switches focus using task manager everything is greyed out and nothing works. I have tested the file from my computer and it is fine, which suggests a problem with his machine or installation. Does anyone have any ideas? Cheers, Steve Dooza wrote: > Hi there, > I have an Excel 2003 user who...

Another simple query
Dear all, I have a table that contains first names and last names in different fields. Is there any way to write a query that will give as a result the first name and last name in the same field? I hope this makes sense. Thanks in advance! SELECT [last_name_field] & ", " & [first_name_field] AS whole_name FROM [your_name_table] Change the field and table names to whatever your actual fields and tables are. Cheers, Jason Lepack On Apr 23, 9:47 am, Homer <peter.a.r...@googlemail.com> wrote: > Dear all, > > I have a table that contains first names an...

Entourage doesn't even try connect to Exchange server
Hi! My colleague has trouble with Entourage 2008 (12.2.3). Since a week back he cannot connect to Exchange anymore. Usually when we start up Entourage and it connects to the Exchange server it warns that there's no root certificate installed and in that dialog we press �OK� and get connected anyway. Now this has stopped working and we've done all I know of ��reinstalled Office 2008 and re-applied the updates, removed all preferences for Entourage and Office, removed the �Microsoft User Data� folder and tried setting things up from scratch. No go. But. It works just f...

Query query
I am trying to create a new field in which it shows the sum total of 10 fields (Charge Time, Charge Time 2, Charge Time 3, etc.); what is the easiest way to do this? -- Joe NewFieldName: [Charge Time] + [Charge Time 2] + [Charge Time 3] .... etc -- Good Luck BS"D "joet5402" wrote: > I am trying to create a new field in which it shows the sum total of 10 > fields (Charge Time, Charge Time 2, Charge Time 3, etc.); what is the easiest > way to do this? > -- > Joe I tried this, and it doesn't work. Is there something I'm forgetting? -- Joe ...

group by query trouble
I'm trying to run a query that counts the number of people with hemoglobin of type SS, type SC, and then all others. There are about 12 different kinds of types. Basically I want a count for SS, a count for SC, and then a count that totals all the others into one count. Hopefully that makes sense. I'm using group by for the SS and SC which works great, but I'm not sure how to tell it to add up the others. I'm not a big fan of nested IIf statements, but this should work after you put in the proper field and table names: SELECT IIf([Hemoglobin]="SC","SC&...

To Query or not to Query??
Hello all - I'm a newbe to Access but have made great progress. I'm using Acess 2003. The db is up and running prefectly. Now I need to tackle the reporting. I have seen posts about reports and queries and am a little confused. Do I need to create a query to run my reports off of? I have a tabbed subform in the main form. There are seven tabs breaking up all the services we provide. Like "Promo Items", "Leads", "Client Printed Material","Internal Print Material" and so on. The main form has the User, Branch and Marketing Rep. I need to...

working with excel
i am using check boxs for yes and no questions,how do i simplify the size and centering them on a row and column? There are two different checkboxes--one from the controltoolbox toolbar and one from the forms toolbar. This code will fill the topleft cell with the checkbox: Option Explicit Sub testme1() Dim OLEObj As OLEObject Dim myCBX As CheckBox For Each OLEObj In ActiveSheet.OLEObjects If TypeOf OLEObj.Object Is MSForms.CheckBox Then With OLEObj .Top = .TopLeftCell.Top .Height = .TopLeftCell.Height .Wi...

Rule does not work
Using Outlook 2003 and trying to get a rule to automatically forward a message after it arrives in the inbox. The rule works fine when manually (run rules now) run. Have tried on a different computer with same results. Have tried sending to various recipients with same results. Have tried switching back and forth between cached and normal mode. If the rule works manually, why does it not work automatically? What am I missing? Still seeking help on this issue... >-----Original Message----- >Using Outlook 2003 and trying to get a rule to >automatically forward a message ...

Dynamic Query
Hi! I am trying to dynamically modify my pass-through query containing a procedure call with 2 parameters. When I run my access app, I get this error: "Object or provider is not capable of performing reuqested operation." Below is my access code: Dim varItem As Variant Dim strSQL As String Dim cat As ADOX.Catalog Dim cmd As ADODB.Command Dim strMyDate As String, dtMyDate As Date dtMyDate = CDate([Forms]![ySalesHistory]![Start Date]) strMyDate = Format(dtMyDate, "yyyymmdd") strSQL = "procCustomerSalesandPayments '" & s...