Simple Query

S

Sammy

Hi,

I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.

Can you help? Thanks much.
 
S

Sammy

Thanks Karl. I ran the query, the prompt came up, instead of typing attorney
initals I typed Like "*" and it didnt' work. Instead of seeing all the
records, it came up with none. What am I doing wrong?

KARL DEWEY said:
Did you use the wildcard like this --
Like "*"
--
KARL DEWEY
Build a little - Test a little


Sammy said:
Hi,

I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.

Can you help? Thanks much.
 
K

KARL DEWEY

Like "*" is the criteria for the query.

Post the SQL for your query so it can be edited. Open the query in design
view, click on menu VIEW - SQL View, highlight all, copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


Sammy said:
Thanks Karl. I ran the query, the prompt came up, instead of typing attorney
initals I typed Like "*" and it didnt' work. Instead of seeing all the
records, it came up with none. What am I doing wrong?

KARL DEWEY said:
Did you use the wildcard like this --
Like "*"
--
KARL DEWEY
Build a little - Test a little


Sammy said:
Hi,

I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.

Can you help? Thanks much.
 
S

Sammy

Thanks. Here it is:

SELECT tblMain.Main_ID, tblMain.Salutation, tblMain.Last_Name, tblMain.MI,
tblMain.First_Name, tblMain.Organization, tblMain.Address,
tblMain.Secondary_Address, tblMain.City, tblMain.State, tblMain.Zip,
tblMain.Plus_4, tblMailing.Accountant, tblMain.Billing_Atty
FROM tblMain INNER JOIN tblMailing ON tblMain.Main_ID =
tblMailing.Main_Rec_FK_ID
WHERE (((tblMailing.Accountant)=Yes) AND ((tblMain.Billing_Atty)=[Enter Atty
Initials]));


When I enter the attorney initials in the prompt it works fine, if I try to
get all records by typing Like "*" I get nothing. Thanks for helping

KARL DEWEY said:
Like "*" is the criteria for the query.

Post the SQL for your query so it can be edited. Open the query in design
view, click on menu VIEW - SQL View, highlight all, copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


Sammy said:
Thanks Karl. I ran the query, the prompt came up, instead of typing attorney
initals I typed Like "*" and it didnt' work. Instead of seeing all the
records, it came up with none. What am I doing wrong?

KARL DEWEY said:
Did you use the wildcard like this --
Like "*"
--
KARL DEWEY
Build a little - Test a little


:

Hi,

I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.

Can you help? Thanks much.
 
M

Marshall Barton

Sammy said:
I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.


Try using the criteria:

Like [Enter Atty initials]

then you can match all records by entering a single
asterick.

You can use the other wildcards to do such things as match
first and last initial with J?D
 
S

Sammy

Thanks. We're getting closer. That worked for all records that had an
attorney designation. The records that didn't have an attorney assigned got
left out. How can I tell it "all records"? Thanks!

Marshall Barton said:
Sammy said:
I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.


Try using the criteria:

Like [Enter Atty initials]

then you can match all records by entering a single
asterick.

You can use the other wildcards to do such things as match
first and last initial with J?D
 
K

KARL DEWEY

Try this --
SELECT tblMain.Main_ID, tblMain.Salutation, tblMain.Last_Name, tblMain.MI,
tblMain.First_Name, tblMain.Organization, tblMain.Address,
tblMain.Secondary_Address, tblMain.City, tblMain.State, tblMain.Zip,
tblMain.Plus_4, tblMailing.Accountant, tblMain.Billing_Atty
FROM tblMain INNER JOIN tblMailing ON tblMain.Main_ID =
tblMailing.Main_Rec_FK_ID
WHERE (tblMailing.Accountant=Yes) AND (tblMain.Billing_Atty=[Enter Atty
Initials - press ENTER for all] OR =[Enter Atty Initials - press ENTER for
all] Is Null);

--
KARL DEWEY
Build a little - Test a little


Sammy said:
Thanks. Here it is:

SELECT tblMain.Main_ID, tblMain.Salutation, tblMain.Last_Name, tblMain.MI,
tblMain.First_Name, tblMain.Organization, tblMain.Address,
tblMain.Secondary_Address, tblMain.City, tblMain.State, tblMain.Zip,
tblMain.Plus_4, tblMailing.Accountant, tblMain.Billing_Atty
FROM tblMain INNER JOIN tblMailing ON tblMain.Main_ID =
tblMailing.Main_Rec_FK_ID
WHERE (((tblMailing.Accountant)=Yes) AND ((tblMain.Billing_Atty)=[Enter Atty
Initials]));


When I enter the attorney initials in the prompt it works fine, if I try to
get all records by typing Like "*" I get nothing. Thanks for helping

KARL DEWEY said:
Like "*" is the criteria for the query.

Post the SQL for your query so it can be edited. Open the query in design
view, click on menu VIEW - SQL View, highlight all, copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


Sammy said:
Thanks Karl. I ran the query, the prompt came up, instead of typing attorney
initals I typed Like "*" and it didnt' work. Instead of seeing all the
records, it came up with none. What am I doing wrong?

:

Did you use the wildcard like this --
Like "*"
--
KARL DEWEY
Build a little - Test a little


:

Hi,

I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.

Can you help? Thanks much.
 
S

Sammy

I got this error message:


Syntax error (missing operator) in (tblMailing.Accountant=Yes) AND
(tblMain.Billing_Atty=[Enter Atty
Initials - press ENTER for all] OR =[Enter Atty Initials - press ENTER for
all] Is Null);

then when I click ok on that, it highlights the "=" in "=[Enter Atty
Initials - press ENTER for all] Is Null);"

I tried to fiddle with it based on what I know but it has figured out that I
don't know what I'm doing and is enjoying making me crazy.

Also it prompts for the attorney initials, then again for attorney initials
with the press Enter option.

Thanks for helping me.

KARL DEWEY said:
Try this --
SELECT tblMain.Main_ID, tblMain.Salutation, tblMain.Last_Name, tblMain.MI,
tblMain.First_Name, tblMain.Organization, tblMain.Address,
tblMain.Secondary_Address, tblMain.City, tblMain.State, tblMain.Zip,
tblMain.Plus_4, tblMailing.Accountant, tblMain.Billing_Atty
FROM tblMain INNER JOIN tblMailing ON tblMain.Main_ID =
tblMailing.Main_Rec_FK_ID
WHERE (tblMailing.Accountant=Yes) AND (tblMain.Billing_Atty=[Enter Atty
Initials - press ENTER for all] OR =[Enter Atty Initials - press ENTER for
all] Is Null);

--
KARL DEWEY
Build a little - Test a little


Sammy said:
Thanks. Here it is:

SELECT tblMain.Main_ID, tblMain.Salutation, tblMain.Last_Name, tblMain.MI,
tblMain.First_Name, tblMain.Organization, tblMain.Address,
tblMain.Secondary_Address, tblMain.City, tblMain.State, tblMain.Zip,
tblMain.Plus_4, tblMailing.Accountant, tblMain.Billing_Atty
FROM tblMain INNER JOIN tblMailing ON tblMain.Main_ID =
tblMailing.Main_Rec_FK_ID
WHERE (((tblMailing.Accountant)=Yes) AND ((tblMain.Billing_Atty)=[Enter Atty
Initials]));


When I enter the attorney initials in the prompt it works fine, if I try to
get all records by typing Like "*" I get nothing. Thanks for helping

KARL DEWEY said:
Like "*" is the criteria for the query.

Post the SQL for your query so it can be edited. Open the query in design
view, click on menu VIEW - SQL View, highlight all, copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


:

Thanks Karl. I ran the query, the prompt came up, instead of typing attorney
initals I typed Like "*" and it didnt' work. Instead of seeing all the
records, it came up with none. What am I doing wrong?

:

Did you use the wildcard like this --
Like "*"
--
KARL DEWEY
Build a little - Test a little


:

Hi,

I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.

Can you help? Thanks much.
 
K

KARL DEWEY

Is tblMailing.Accountant a logic field or a text field. If it is a text
field then 'Yes' must be in quotes like this -- (tblMailing.Accountant="Yes")
AND

My error - Delete the equal following the OR ---
WHERE (tblMailing.Accountant=Yes) AND (tblMain.Billing_Atty=[Enter Atty
Initials - press ENTER for all] OR [Enter Atty Initials - press ENTER for
all] Is Null);

--
KARL DEWEY
Build a little - Test a little


Sammy said:
I got this error message:


Syntax error (missing operator) in (tblMailing.Accountant=Yes) AND
(tblMain.Billing_Atty=[Enter Atty
Initials - press ENTER for all] OR =[Enter Atty Initials - press ENTER for
all] Is Null);

then when I click ok on that, it highlights the "=" in "=[Enter Atty
Initials - press ENTER for all] Is Null);"

I tried to fiddle with it based on what I know but it has figured out that I
don't know what I'm doing and is enjoying making me crazy.

Also it prompts for the attorney initials, then again for attorney initials
with the press Enter option.

Thanks for helping me.

KARL DEWEY said:
Try this --
SELECT tblMain.Main_ID, tblMain.Salutation, tblMain.Last_Name, tblMain.MI,
tblMain.First_Name, tblMain.Organization, tblMain.Address,
tblMain.Secondary_Address, tblMain.City, tblMain.State, tblMain.Zip,
tblMain.Plus_4, tblMailing.Accountant, tblMain.Billing_Atty
FROM tblMain INNER JOIN tblMailing ON tblMain.Main_ID =
tblMailing.Main_Rec_FK_ID
WHERE (tblMailing.Accountant=Yes) AND (tblMain.Billing_Atty=[Enter Atty
Initials - press ENTER for all] OR [Enter Atty Initials - press ENTER for
all] Is Null);

--
KARL DEWEY
Build a little - Test a little


Sammy said:
Thanks. Here it is:

SELECT tblMain.Main_ID, tblMain.Salutation, tblMain.Last_Name, tblMain.MI,
tblMain.First_Name, tblMain.Organization, tblMain.Address,
tblMain.Secondary_Address, tblMain.City, tblMain.State, tblMain.Zip,
tblMain.Plus_4, tblMailing.Accountant, tblMain.Billing_Atty
FROM tblMain INNER JOIN tblMailing ON tblMain.Main_ID =
tblMailing.Main_Rec_FK_ID
WHERE (((tblMailing.Accountant)=Yes) AND ((tblMain.Billing_Atty)=[Enter Atty
Initials]));


When I enter the attorney initials in the prompt it works fine, if I try to
get all records by typing Like "*" I get nothing. Thanks for helping

:

Like "*" is the criteria for the query.

Post the SQL for your query so it can be edited. Open the query in design
view, click on menu VIEW - SQL View, highlight all, copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


:

Thanks Karl. I ran the query, the prompt came up, instead of typing attorney
initals I typed Like "*" and it didnt' work. Instead of seeing all the
records, it came up with none. What am I doing wrong?

:

Did you use the wildcard like this --
Like "*"
--
KARL DEWEY
Build a little - Test a little


:

Hi,

I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.

Can you help? Thanks much.
 
S

Sammy

THANK YOU IT WORKS GREAT. THANKS FOR YOUR TIME

KARL DEWEY said:
Is tblMailing.Accountant a logic field or a text field. If it is a text
field then 'Yes' must be in quotes like this -- (tblMailing.Accountant="Yes")
AND

My error - Delete the equal following the OR ---
WHERE (tblMailing.Accountant=Yes) AND (tblMain.Billing_Atty=[Enter Atty
Initials - press ENTER for all] OR [Enter Atty Initials - press ENTER for
all] Is Null);

--
KARL DEWEY
Build a little - Test a little


Sammy said:
I got this error message:


Syntax error (missing operator) in (tblMailing.Accountant=Yes) AND
(tblMain.Billing_Atty=[Enter Atty
Initials - press ENTER for all] OR =[Enter Atty Initials - press ENTER for
all] Is Null);

then when I click ok on that, it highlights the "=" in "=[Enter Atty
Initials - press ENTER for all] Is Null);"

I tried to fiddle with it based on what I know but it has figured out that I
don't know what I'm doing and is enjoying making me crazy.

Also it prompts for the attorney initials, then again for attorney initials
with the press Enter option.

Thanks for helping me.

KARL DEWEY said:
Try this --
SELECT tblMain.Main_ID, tblMain.Salutation, tblMain.Last_Name, tblMain.MI,
tblMain.First_Name, tblMain.Organization, tblMain.Address,
tblMain.Secondary_Address, tblMain.City, tblMain.State, tblMain.Zip,
tblMain.Plus_4, tblMailing.Accountant, tblMain.Billing_Atty
FROM tblMain INNER JOIN tblMailing ON tblMain.Main_ID =
tblMailing.Main_Rec_FK_ID
WHERE (tblMailing.Accountant=Yes) AND (tblMain.Billing_Atty=[Enter Atty
Initials - press ENTER for all] OR [Enter Atty Initials - press ENTER for
all] Is Null);

--
KARL DEWEY
Build a little - Test a little


:

Thanks. Here it is:

SELECT tblMain.Main_ID, tblMain.Salutation, tblMain.Last_Name, tblMain.MI,
tblMain.First_Name, tblMain.Organization, tblMain.Address,
tblMain.Secondary_Address, tblMain.City, tblMain.State, tblMain.Zip,
tblMain.Plus_4, tblMailing.Accountant, tblMain.Billing_Atty
FROM tblMain INNER JOIN tblMailing ON tblMain.Main_ID =
tblMailing.Main_Rec_FK_ID
WHERE (((tblMailing.Accountant)=Yes) AND ((tblMain.Billing_Atty)=[Enter Atty
Initials]));


When I enter the attorney initials in the prompt it works fine, if I try to
get all records by typing Like "*" I get nothing. Thanks for helping

:

Like "*" is the criteria for the query.

Post the SQL for your query so it can be edited. Open the query in design
view, click on menu VIEW - SQL View, highlight all, copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


:

Thanks Karl. I ran the query, the prompt came up, instead of typing attorney
initals I typed Like "*" and it didnt' work. Instead of seeing all the
records, it came up with none. What am I doing wrong?

:

Did you use the wildcard like this --
Like "*"
--
KARL DEWEY
Build a little - Test a little


:

Hi,

I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.

Can you help? Thanks much.
 
M

Marshall Barton

THen use the criteria:

Like [Enter Atty initials] OR Is Null
--
Marsh
MVP [MS Access]

Thanks. We're getting closer. That worked for all records that had an
attorney designation. The records that didn't have an attorney assigned got
left out. How can I tell it "all records"? Thanks!

Marshall Barton said:
Sammy said:
I've created a marketing database for a lawfirm. I have a query based on my
MAIN table (containing contact names, addresses and attorney designation) and
a MAILING (containing areas of interest such as employment law, realestate,
etc.) table.

I want to create contact lists by Attorney but I also want to use the same
query to get a complete list of all the contacts.

I've created a parameter query with the following: [Enter Attorney Initials]
in the criteria row under the AttyInitials field which works great. Now I
want to be able to type a wildcard in the prompt so that it will give me ALL
CONTACTS REGARDLESS OF ATTORNEY INITIALS. I've tried all the wildcards, ***,
???, %, etc., but can't get it to give me all records.


Try using the criteria:

Like [Enter Atty initials]

then you can match all records by entering a single
asterick.

You can use the other wildcards to do such things as match
first and last initial with J?D
 

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