Newbie Query Question

G

GraVeDiGGer

Ok its been forever and a day (nearly a decade) since I have done ANY
database work and to say I am rusty would be an understatement.

I am in a new position at a new company and they use rather antiquated
techniques in their passing of information thus I figured a database
would solve many issues with data integrity and the likes.

My post is two fold, first off what books do you "savvy" users
recommend for someone who is getting back into DB work.
I plan to spend a couple of weeks refreshing and reading so as not to
become an abuser of the group.

We are using Access 2000....

Now for the second part.... I am writing a query

I am concerned with two pieces of data

Retention and Phone

If the phone is null I do now want to see the record
thus "Is Not Null" returns any record where the phone is present

the second part of the query is that I want to only display records
where the field "retention" does not contain "cc=ok" or is empty
so I use "<>"cc=ok" Or Is Null" and viola this returns only empty
records in which retention is not equal to "cc=ok" and that has a
phone number....

The issue I am having is that as my associate calls on these customers
they will use a combo box to record a predetermined call response and
cycle through the records... call reasons are

No Answer
Call Back 1
Call Back 2
Call Back 3
Wrong Number
Fax
No Number
Cancel
Business
OK
Not in Service
Never Ordered

as they make calls and advance to the next record it populates the
table with one of these reasons... at this point I want them to only
see records which are null or have the first four call reasons in
retention

No Answer
Call Back 1
Call Back 2
Call Back 3

so I use

([Retention]<>"cc=OK" Or [Retention] Is Null) Or ( [Retention] = no
answer or [Retention] = "call*")

and it fails.. I get records which say

Wrong Number
Fax
No Number
Cancel
Business
OK
Not in Service
Never Ordered

as well....

What am I doing wrong?

Thanks in advance
 
B

Baz

Not entirely sure I follow you. However, your expression:

([Retention]<>"cc=OK" Or [Retention] Is Null) Or ( [Retention] = no answer
or [Retention] = "call*")

is a bit of a mess, and I can't believe it would return anything but an
error with the missing quote marks around "no answer".

Furthermore, this part:

([Retention]<>"cc=OK" Or [Retention] Is Null)

guarantees that you will get all records except "cc=OK", regardless of what
is in the rest of the expression. Finally, when using wildcards you need
the "Like" operator, not the "=" operator.

Overall, I'm guessing that you want this:

[Retention] Is Null Or [Retention] = "no answer" or [Retention] Like "call*"
 
G

GraVeDiGGer

My thanks to you

too simple

Can you suggest any books that are worth squat so I don't become a
bother to the group? Like I said its been a long long time for me and
the proggie I am working on is nothing that complex.....

Not entirely sure I follow you. However, your expression:

([Retention]<>"cc=OK" Or [Retention] Is Null) Or ( [Retention] = no answer
or [Retention] = "call*")

is a bit of a mess, and I can't believe it would return anything but an
error with the missing quote marks around "no answer".

Furthermore, this part:

([Retention]<>"cc=OK" Or [Retention] Is Null)

guarantees that you will get all records except "cc=OK", regardless of what
is in the rest of the expression. Finally, when using wildcards you need
the "Like" operator, not the "=" operator.

Overall, I'm guessing that you want this:

[Retention] Is Null Or [Retention] = "no answer" or [Retention] Like "call*"


GraVeDiGGer said:
Ok its been forever and a day (nearly a decade) since I have done ANY
database work and to say I am rusty would be an understatement.

I am in a new position at a new company and they use rather antiquated
techniques in their passing of information thus I figured a database
would solve many issues with data integrity and the likes.

My post is two fold, first off what books do you "savvy" users
recommend for someone who is getting back into DB work.
I plan to spend a couple of weeks refreshing and reading so as not to
become an abuser of the group.

We are using Access 2000....

Now for the second part.... I am writing a query

I am concerned with two pieces of data

Retention and Phone

If the phone is null I do now want to see the record
thus "Is Not Null" returns any record where the phone is present

the second part of the query is that I want to only display records
where the field "retention" does not contain "cc=ok" or is empty
so I use "<>"cc=ok" Or Is Null" and viola this returns only empty
records in which retention is not equal to "cc=ok" and that has a
phone number....

The issue I am having is that as my associate calls on these customers
they will use a combo box to record a predetermined call response and
cycle through the records... call reasons are

No Answer
Call Back 1
Call Back 2
Call Back 3
Wrong Number
Fax
No Number
Cancel
Business
OK
Not in Service
Never Ordered

as they make calls and advance to the next record it populates the
table with one of these reasons... at this point I want them to only
see records which are null or have the first four call reasons in
retention

No Answer
Call Back 1
Call Back 2
Call Back 3

so I use

([Retention]<>"cc=OK" Or [Retention] Is Null) Or ( [Retention] = no
answer or [Retention] = "call*")

and it fails.. I get records which say

Wrong Number
Fax
No Number
Cancel
Business
OK
Not in Service
Never Ordered

as well....

What am I doing wrong?

Thanks in advance
 
B

Baz

Sorry, I've never seen a starting/intermediate book that was any good. The
Access (version) Developers' Handbook and the VBA Developers' Handbook, from
Sybex, are both superb but very expensive and quite advanced.

Do make extensive use of the help system. In Access 2003 it's finally
getting better after being useless in 2000 and 2002 (I often have Access 97
open while working just so I can use it's far superior help system).
Knowing Microsoft they've probably screwed it up again in Access 2007.

Google groups and the Microsoft Knowledge Base are excellent resources, as
is the Access Web and many websites run by posters here. I've never needed
to post more than a handful of questions here because 999 times out of 1000
I find the answer in one of these resource. Loads of links here:

http://www.granite.ab.ca/access/accesslinks.htm


GraVeDiGGer said:
My thanks to you

too simple

Can you suggest any books that are worth squat so I don't become a
bother to the group? Like I said its been a long long time for me and
the proggie I am working on is nothing that complex.....

Not entirely sure I follow you. However, your expression:

([Retention]<>"cc=OK" Or [Retention] Is Null) Or ( [Retention] = no answer
or [Retention] = "call*")

is a bit of a mess, and I can't believe it would return anything but an
error with the missing quote marks around "no answer".

Furthermore, this part:

([Retention]<>"cc=OK" Or [Retention] Is Null)

guarantees that you will get all records except "cc=OK", regardless of what
is in the rest of the expression. Finally, when using wildcards you need
the "Like" operator, not the "=" operator.

Overall, I'm guessing that you want this:

[Retention] Is Null Or [Retention] = "no answer" or [Retention] Like "call*"


GraVeDiGGer said:
Ok its been forever and a day (nearly a decade) since I have done ANY
database work and to say I am rusty would be an understatement.

I am in a new position at a new company and they use rather antiquated
techniques in their passing of information thus I figured a database
would solve many issues with data integrity and the likes.

My post is two fold, first off what books do you "savvy" users
recommend for someone who is getting back into DB work.
I plan to spend a couple of weeks refreshing and reading so as not to
become an abuser of the group.

We are using Access 2000....

Now for the second part.... I am writing a query

I am concerned with two pieces of data

Retention and Phone

If the phone is null I do now want to see the record
thus "Is Not Null" returns any record where the phone is present

the second part of the query is that I want to only display records
where the field "retention" does not contain "cc=ok" or is empty
so I use "<>"cc=ok" Or Is Null" and viola this returns only empty
records in which retention is not equal to "cc=ok" and that has a
phone number....

The issue I am having is that as my associate calls on these customers
they will use a combo box to record a predetermined call response and
cycle through the records... call reasons are

No Answer
Call Back 1
Call Back 2
Call Back 3
Wrong Number
Fax
No Number
Cancel
Business
OK
Not in Service
Never Ordered

as they make calls and advance to the next record it populates the
table with one of these reasons... at this point I want them to only
see records which are null or have the first four call reasons in
retention

No Answer
Call Back 1
Call Back 2
Call Back 3

so I use

([Retention]<>"cc=OK" Or [Retention] Is Null) Or ( [Retention] = no
answer or [Retention] = "call*")

and it fails.. I get records which say

Wrong Number
Fax
No Number
Cancel
Business
OK
Not in Service
Never Ordered

as well....

What am I doing wrong?

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top