Results from a parameter query

E

Emily

I am new to Access and learning it as I go, frantically looking through
websites and guidebooks. But they have failed me.

The database is a basic library database, with M2M relationships for
author and subject, so it is probably those M2M relationships screwing
this up (Lord knows they caused me enough trouble already). I have a
main table (Books) which I need the title from, then the Author table
which is linked to Books through a junction table. Same deal with
subjects. I am trying to run a query to retrieve records that I
created between certain dates. So I use DateEntered and Title from the
Books table and Author from the Authors table (which is linked to Books
through a junction table). The problem is, when I run the query, I
enter my dates, and then I get a list of every book I entered on those
dates, but the list comes out sorted by author which is what I wanted,
but it lists every title from those dates under every author in the
database. It is 2,000 pages long. Needless to say, this is
unacceptable.

Again, what I am trying to do is retrieve a list of the books I entered
during a certain week (using a parameter query), and then view
Title/Author information for those records.

I have a feeling the junction tables may be the key to this, so I am
going to screw around with those in queries and see what I can come up
with.

Thanks in advance for any help.
 
J

John Vinson

I am new to Access and learning it as I go, frantically looking through
websites and guidebooks. But they have failed me.

The database is a basic library database, with M2M relationships for
author and subject, so it is probably those M2M relationships screwing
this up (Lord knows they caused me enough trouble already). I have a
main table (Books) which I need the title from, then the Author table
which is linked to Books through a junction table. Same deal with
subjects. I am trying to run a query to retrieve records that I
created between certain dates. So I use DateEntered and Title from the
Books table and Author from the Authors table (which is linked to Books
through a junction table). The problem is, when I run the query, I
enter my dates, and then I get a list of every book I entered on those
dates, but the list comes out sorted by author which is what I wanted,
but it lists every title from those dates under every author in the
database. It is 2,000 pages long. Needless to say, this is
unacceptable.

Again, what I am trying to do is retrieve a list of the books I entered
during a certain week (using a parameter query), and then view
Title/Author information for those records.

I have a feeling the junction tables may be the key to this, so I am
going to screw around with those in queries and see what I can come up
with.

Thanks in advance for any help.

It would help us if you would be so kind as to post a description of
the structure of your tables, and the SQL view of the query that
you're running. We're in the dark right now!

John W. Vinson[MVP]
 
M

Michel Walsh

Hi,



SELECT books.*
FROM books
WHERE dateEntered BETWEEN CDate([first date:] ) AND CDate([last date (at
midnight by default)])


should return the records where the dateEntered falls between the limit you
supply.

Add the other tables, one at a time, with the proper inner join, to get
accessory information held in these other tables. Graphically, drag and drop
the field, form the other table, over the field to be matched in table books
(in the upper half of the query designer).



Hoping it may help,
Vanderghast, Access MVP
 
E

Emily

I did not understand what to do with the SELECT books part, so I
decided to try the other part about dragging and dropping. So I stuck
the junction table in the query, dragged and dropped, and the query
worked. Hallelulia. I stuck it in a report and it is exactly what I
wanted. Thank you for the help.
 

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