queries

  • Thread starter Thread starter Larry Dietrick
  • Start date Start date
L

Larry Dietrick

I have a couple of problems: First, when let's say I have
a table with Columns A, B, and C. I want to make a query
such that when I run it, it outputs the contents of
Columns A and B for all the entries that have the
value "yes" in Column C (notice that is not one of the
two columns I want it to output.) I would want the query
to output this content in two of its own columns.

Secondly, I have a column in my table full of numbers. I
want the query to tell me how many of those numbers in
that column are less than 30. How do I do this?

Thanks for any help.
 
See answers in-line.

--
HTH
Van T. Dinh
MVP (Access)



Larry Dietrick said:
I have a couple of problems: First, when let's say I have
a table with Columns A, B, and C. I want to make a query
such that when I run it, it outputs the contents of
Columns A and B for all the entries that have the
value "yes" in Column C (notice that is not one of the
two columns I want it to output.) I would want the query
to output this content in two of its own columns.
Depending on whether C is a Boolean Field or a Text Field:

For Boolean:
SELECT A, B
FROM YourTable
WHERE C = True

For Text:
SELECT A, B
FROM YourTable
WHERE C = "Yes"


Secondly, I have a column in my table full of numbers. I
want the query to tell me how many of those numbers in
that column are less than 30. How do I do this?
SELECT Count(*) AS CountOfRecord
FROM YourTable
WHERE [NumberField] < 30

These are basic stuff that is covered by any Access book. If you haven't
read any Access book, even one of the introductory books, it will help you
substantially. It may be true that Access is easy to use as per Microsoft's
claim (for a flat database like a list of contacts), it is *impossible* to
use the full power of Access unless you read Access books.
 
Back
Top