Query Not = question

MS Office Access

    Next

  • 1. how to locate currency records with too many decimal places?
    only example some records have $231.035, which shows when you click in it. how can i fiilter these out to correct them?
  • 2. Including a Sum from a calculated field in a query
    I have a subform that totals a list of values, then I place this sum in a form. The Control Source for the field containing the sum is as follows. Control Source: =[subfrmBasis].Form!TotalShares Now I want to include this sum in a query that uses other fields in the form (in other words fields from the table the form is based on). I don't understand how to get the sum value in my query. Here are some things I have considered. The control source for the field cannot be based on both a field in a table and calculated field. I tried mimicking the value to another field but have been unsuccessful. Me!No_Shs=[Forms]![frmMutualFundSymbol]![SumTotalShares] wont work. Anyone know a good way to do this. Thanks in advance, if I don't thank you later. Les
  • 3. Please help, update Query (2 tables)
    Not sure why, but I have one table with ID, DOB. 2nd table ID, DOB. When I try to update table2, Table1 field is emptied but table 2 not updated. Any ideas? Thanks
  • 4. Select query depending on two criteria
    I have a query that I want to select records based on two sets of criteria. I want to select if the ship date is less than two years OR there is a qty on hand. How would the query be setup? Thanks for your assistance.

Query Not = question

Postby Junior » Sat, 19 Jun 2004 14:12:51 GMT

just realized my query isn't working properly and i'm stumped

Have a text field [RPlan] in a table
QRY1  contains [RPlan]
I want to find all records in QRY1 that do not contain "XXX" in [Rplan]

not="XXX" doesn't work
null works but doesn't ensure only XXX is the only records excluded

What is the proper way to exclude only records containing XXX when querying
QRY1 in a second query??



Re: Query Not = question

Postby Gary Walter » Sat, 19 Jun 2004 14:21:03 GMT

Hi Junior,

WHERE NZ(([RPlan]<>'XXX'),-1)

"Junior" wrote



Re: Query Not = question

Postby Junior » Sat, 19 Jun 2004 15:20:07 GMT

Thanks




querying



Re: Query Not = question

Postby Gary Walter » Sat, 19 Jun 2004 15:46:03 GMT

Just to be sure,
WHERE returns record
when condition = -1 (True)

[RPlan]    NZ(([RPlan]<>'XXX'),-1)
'XXX'                  0 (False)
<>'XXX'             -1 (True)
Null                     -1 (True)

or

[RPlan]    NZ(([RPlan]<>'XXX'),0)
'XXX'                  0 (False)
<>'XXX'             -1 (True)
Null                      0 (False)




Similar Threads:

1.Null & Is Not Null Query Question

I have a query with 3 fields of [EmployeeID], [FirstDay] and [LastDay] 
(Firstday and LastDay are date fields)  I am trying to get my query to give 
the results of the Missing dates for both the Firstday and Lastday.  Some 
employees may have the firstday or the lastday missing or both.  I have been 
experimenting with Is Null and Is not null or both in the criteria giving 
partial results.  If I put Is null in the Firstday criteria only, I do get a 
list of employees missing the Firstday dates.  If I also put Is Null in the 
Lastday criteria, All I get is employees with only the Firstday and the 
lastday dates missing, but not employees with either/or the firstday and 
lastday missing.  Please help..Randy 


2.MS Access 2003 CrossTab Query Question using VBA--Item not found i

When running a crosstab query, one cannot tell ahead of time what columns are 
going to appear based on parameter criteria fed to an underlying query that a 
crosstab query is created from.  That, of course, is the dynamic nature of 
crosstab result sets.  However, if I know all the possible values for the 
columns because the field the column is based on has a finite number of 
possible values, how can I test if a particular column is present using VBA?  
With the usual construct of rs![X], where X is one of the possible column 
values, if that value does not appear when the crosstab is run, a debug of 
that if statement will show the error message that "item not found in this 
collection".  MY QUESTION IS:

how can I error trap for this?  That is, if I want to test for rs![X].value 
and it does not exist, then the code just skips by if on error resume is 
used; otherwise the cdoe breaks.  I would ideally like to have another IF 
statement outside of the one above that checks for the existance of that 
column, and I do not know how to do this.  Is there an error code associated 
with "item not found in this collection" that I can look for?  If so, what 
function would I use to test for the error condition and what value would it 
need to equal for ""item not found in this collection"????   And if this is 
not a possible or best approach, how should I detect/look for a particular 
column in a crosstab query when the query is run in code and the recordset is 
processed in code looking for a specific resulting column and its value???

Thanks to anyone who can help me!!!!

Mike S.

3.MS Access 2003 CrossTab Query Question using VBA--Item not fou

There is no rs.Field in the collection. There is an rs.Fields with Append, 
Count, Delete, and Refresh methods associated with it.  What am I missing 
here?

"MGFoster" wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> What you're really looking for is the name of the Field (it is the
> object in the Fields collection that is not being found); that is easily
> found:
> 
>    If rs.Field = "name of field" Then
>      ' do something w/ the field
>    End If
> 
> -- 
> MGFoster:::mgf00 <at> earthlink <decimal-point> net
> Oakland, CA (USA)
> 
> -----BEGIN PGP SIGNATURE-----
> Version: PGP for Personal Privacy 5.0
> Charset: noconv
> 
> iQA/AwUBQ9F1ioechKqOuFEgEQLyZQCg43Zl6AO+KLyP7okBGeoxdKvgTV0AoKDr
> vAzScW9oG0Ia1fBAJaUi4xyz
> =6nhz
> -----END PGP SIGNATURE-----
> 
> 
> Mike S. S. wrote:
> > When running a crosstab query, one cannot tell ahead of time what columns are 
> > going to appear based on parameter criteria fed to an underlying query that a 
> > crosstab query is created from.  That, of course, is the dynamic nature of 
> > crosstab result sets.  However, if I know all the possible values for the 
> > columns because the field the column is based on has a finite number of 
> > possible values, how can I test if a particular column is present using VBA?  
> > With the usual construct of rs![X], where X is one of the possible column 
> > values, if that value does not appear when the crosstab is run, a debug of 
> > that if statement will show the error message that "item not found in this 
> > collection".  MY QUESTION IS:
> > 
> > how can I error trap for this?  That is, if I want to test for rs![X].value 
> > and it does not exist, then the code just skips by if on error resume is 
> > used; otherwise the cdoe breaks.  I would ideally like to have another IF 
> > statement outside of the one above that checks for the existance of that 
> > column, and I do not know how to do this.  Is there an error code associated 
> > with "item not found in this collection" that I can look for?  If so, what 
> > function would I use to test for the error condition and what value would it 
> > need to equal for ""item not found in this collection"????   And if this is 
> > not a possible or best approach, how should I detect/look for a particular 
> > column in a crosstab query when the query is run in code and the recordset is 
> > processed in code looking for a specific resulting column and its value???
> > 
> > Thanks to anyone who can help me!!!!
> > 
> > Mike S.
> 

4.access query question using not " "

need to say not with about eight items

can get it to work with one item but not more than one

how do i do this?

5.Append if not already existing query question?

Remember seeing a post a while back from someone who wanted to add to a 
table only if the data didn't already exist.
Someone suggested a type of query called an "Up" something or other. Can't 
remember - could someone refresh my memory on this please?

Thanks





6. Access 2007 Query question - Unmatched not return results wanted

7. question on tab order...this is not a std question

8. Forms Question or Query Question..



Return to MS Office Access

 

Who is online

Users browsing this forum: No registered users and 83 guest